I have an InTransaction Data Directive, that I want to close an order.
The DD monitors the OrderHed table, for changes to a custom field OrderHed.BillingComplete_c (a boolean)
I then made an Updatable BAQ where users can check off that BillingComplete check box.
I had the DD use a Set Field block to set the OrderHed.OpenOrder to FALSE. But that only sets that field, and doesn’t do the same as the “Close Order” Action in the order entry screen(which also closes the lines and releases).
How can I execute the “Close Order” functionality from within an In-Tran DD?
I could use the Set By Query block to find the open lines and releases related to that order, and close them. But I feel that the “Close Order” function may do much more.
I believe there is a close order method that needs to be called. If you were using a method directive you could use Invoke BO Method and call it without any code. In a data directive you’re going to need to use Usings & References to import dlls so you can call that method. Is it possible to use a method directive?
I’m trying to execute the CloseRelease method on SalesOrder from within custom code in a Data Directive BPM.
In the BPM custom code I’m trying to create the following object:
var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrder>(Db);
I’ve added the reference to the Erp.Contracts.BO.SalesOrder Assembly but when I try to save I get:
Description: There is at least one compilation error.
Details:
Error CS0234: The type or namespace name ‘SalesOrder’ does not exist in the namespace ‘Erp.Contracts’ (are you missing an assembly reference?) [InTran.Auto_Close_Relea.cs(90,79)]
Program: Epicor.Customization.dll
Anyone have any ideas on how to properly resolve the dependency?
Thanks, that worked and I was able to get it to compile and I’ve added enough debug statements to know that the code is being executed but my Release is not getting closed.
Just a wild guess, but does being an in-transaction DD cause problems? Since the In-trans affects the temp table, and your code is trying to make a call to the real table, is there some sort of chicken and egg thing going on?
One In-Tran to do what needs to be done “in-tran” and another standard DD that monitors the results of the In-Tran one (after they’re completed), that does the actual closing.