Quote dataset refresh in post pr BPM

Thanks Jose, I’m back to my original, “Row has been modified by another user” error now.

Here is the detail;

Regards

Adrian

Hey Fellas,

I ran into this thread while fighting through a similar issue, this time with a post-processing directive on SalesOrder.MasterUpdate, but achieving similar results. I went as far as to add the update as a secondary custom code execution, but the refresh does not find its way back to the client UI, which is what I’m assuming is the case of Adrian’s Row Modified error…

I went as far as to capture the order num and publish it, to make sure it was getting passed into GetById correctly. The order number doesn’t seem to be the problem, but the changes are nor visible to the client without a manual refresh:

Erp.Contracts.SalesOrderSvcContract orderSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(Db);

var ttOrderDtl_xRow = (from ttOrderDtl_Row in ttOrderDtl

select ttOrderDtl_Row).FirstOrDefault();

if(ttOrderDtl_xRow != null)

{

int orderNum = ttOrderDtl_xRow.OrderNum;

string orderNumStr = orderNum.ToString();

PublishInfoMessage(orderNumStr, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");

SalesOrderTableset OrderDs = orderSvc.GetByID(orderNum);

this.dsHolder.Attach(OrderDs);

}

Still searching…

Brad

1 Like

litter your code with some of these

Ice.Diagnostics.Log.WriteEntry("Message 1");

and see how far it makes it…

It makes no sense that this wouldn’t work. These messages will show up in the event viewer.

2 Likes

I have finally got to the point where the code runs without any errors but still I have to save and manually refresh to see the price set to zero.
Thank you everyone for your help.
If anyone finds out how to make this work I would be most grateful!!

Best regards

Adrian.

1 Like

That’s a good idea. I went ahead and added some logging. The results: the logs indicated no issues–the BPM through to the end. So, I went ahead and queried the SalesOrderTableset, to confirm that the data was getting loaded

Ice.Diagnostics.Log.WriteEntry(“BPM - declaring order service”);

Erp.Contracts.SalesOrderSvcContract orderSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(Db);

Ice.Diagnostics.Log.WriteEntry(“BPM - firing get by ID”);

SalesOrderTableset OrderDs = orderSvc.GetByID(orderNum);

Ice.Diagnostics.Log.WriteEntry(“BPM - attaching tableset to calling form”);

this.dsHolder.Attach(OrderDs);

Ice.Diagnostics.Log.WriteEntry(“BPM - done”);

var lastLine = (from orderDtl_xRow in OrderDs.OrderDtl

select orderDtl_xRow).LastOrDefault();

if(lastLine != null)

{

string lastLineNum = lastLine.OrderLine.ToString();

Ice.Diagnostics.Log.WriteEntry("BPM - found row. Last Line Num: " + lastLineNum);

}

else

Ice.Diagnostics.Log.WriteEntry(“BPM - GetById did not return data”);

Sure enough, the last line in my log was “BPM - found row. Last Line Num: 9”

So, the Sales Order service is successfully firing the GetDyID method and loading the SalesOrderTableset, but the “this.dsHolder.Attach(OrderDs)” command does not appear to be updating the calling client form.

Brad

What method is this being called on?

post-processing directive on SalesOrder.MasterUpdate

Hi sorry for the late response here-- I have had success refreshing a form this way using the Method Directive, does anyone here know if it’s possible to use the same process to refresh your form from a DATA DIRECTIVE? I am attempting this now and not having any luck.

image

The data directive is only the fields in the table. This may not be the same fields that are in the dataview, as many deal with more than one table at a time. Quote has QuoteHed, QuoteDtl etc… So the data directive doesn’t have all of that to do the refresh.

1 Like

Thanks a lot Brandon. I suspected that. I am now working on moving a data directive into a method directive.