Refreshing the UI from external dll

I see a lot of examples on E10Help on how to refresh the UI from a Post-Proc BPM by using GetByID followed by a this.dsHolder.Attach(ds) statement.

We are using a Post-Proc BPM to invoke an external DLL we created to recalculation Misc Charges by Net Price. Our calculations are working, the data is updating in the database properly, and all Line/Header recalculations are taking place. However, the UI is still showing the old Misc Charge Calculation until we hit refresh on this screen.

Is there a way to use this.dsHolder.Attach(orderDs) in an external DLL?

I recommend against putting any Epicor specific code in an external DLL this just leads to maintenance issues, upgrade problems and requiring you to redeploy and recompile every upgrade.
You should put anything you want in your external DLL such as calculations and such but not actual Epicor logic or Epicor dlls.

Regardless to refresh you should make your External call and then inside Epicor (after) your call returns just call the refresh code.

1 Like

Jose,

I added the refresh code to a custom code node after the external DLL call in my BPM, I get the following error, are there certain methods that the attach cannot be used on? This was a Post-Proc on SalesOrder.UpdateOrderDtlDiscountPercent

Try resultHolder Some of these don’t have a dataset that they pass at all… So they re just returning a dataset.

1 Like

That was it. Thanks a ton, I’ve been trying figure that out for half the day!

1 Like

Heed my warning move your code back if its Epicor specific… not worth the hassle.

Just curious how do you go about debugging your Method Directive BPMs with Custom Come if they’re not in an External DLL? We don’t have the SDK and this was the only way we were able to debug Method Directive Custom Code without writing to the logs or using message boxes.

BPMs generate source code cs files (if setup to do so in the web config)
You can then bring those into a visual studio project and use the remote debugger to debug them.
You can get a template for visual studio for remote debugging from the epicor converter site.

1 Like