Hey everyone,
I have a Pre-Processing BPM on an Updatable BAQ. Ultimately trying to adjust RO releases, but to even get there I have to change a PO from approved to unapproved. To test this, I’m invoking the following:
BO Method Erp.PO.GetByID passing an integer to test (200021) and have created a variable of type POTableset as the return.
Then, I’m invoking BO Method Erp.PO.ChangeApproveSwitch passing false to ApproveValue, [ignore] to ViolationMsg and passing the POTableset variable returned from the GetByID method.
When the BPM executes it throws the error message: POHeader is not available
I’ve tried both using custom c# code and using the widget Invoke PO Method, both producing the same error message.
Anyone have any thoughts? I’ve ran these two actions through the tracelogs and the only difference I see in the tracelogs is that the GetByID returntype is Erp.Tablesets.POTableset and the ChangeApproveSwitch is trying to pass a parameter of Erp.BO.PODataset.
I’m on version 10.2.100.7 of Epicor. Thanks in advance for any assistance!
EDIT: here is the custom code that is producing the same results
var POApproveSwitchDataSet = new Erp.Tablesets.POTableset();
Erp.Contracts.POSvcContract hPOApproveHandle = null;
if (hPOApproveHandle == null) {
hPOApproveHandle = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.POSvcContract>(Db);
}
POApproveSwitchDataSet = hPOApproveHandle.GetByID(PONumCheck);
if (POApproveSwitchDataSet != null) {
hPOApproveHandle.ChangeApproveSwitch(false,out ViolationMsg, ref POApproveSwitchDataSet);
}