Hey folks,
In an updatable BAQ I’m calling an Epicor function with a pot load of i/o arguments. 105 of them.
Before the function call, I explicitly set each argument variable in code to empty, 0, or false, depending on the type and then I set the inputs needed for this run. I don’t get a type error here.
The function runs okay. But when the function exits I get this Server Side Error in the BAQ’s BPM:
BPM runtime caught an unexpected exception of 'InvalidCastException' type.
See more info in the Inner Exception section of Exception Details.
Exception caught in: Epicor.ServiceModel
Error Detail
============
Correlation ID: afb01ad8-0e1d-495b-b8fb-47df0068a769
Description: BPM runtime caught an unexpected exception of 'InvalidCastException' type.
See more info in the Inner Exception section of Exception Details.
Program: System.Private.CoreLib.dll
Method: ChkCast_Helper
Original Exception Type: InvalidCastException
Server Trace Stack: at Epicor.Customization.Bpm.Ubaq.GetListPostProcessingDirective_ValidateTestResults_DF0DD47EE2CF41968B8D97676342C6BC.A003_InvokeEpicorFunctionAction2()
at Epicor.Customization.Bpm.Ubaq.GetListPostProcessingDirective_ValidateTestResults_DF0DD47EE2CF41968B8D97676342C6BC.ExecuteCore(Int32 step)
at Epicor.Customization.Bpm.DirectiveBase`2.Execute() in C:\_releases\ICE\ICE4.2.200.8\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 330
at Epicor.Customization.Bpm.DirectiveBase`2.Execute(TParam parameters) in C:\_releases\ICE\ICE4.2.200.8\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 222
Client Stack Trace
==================
at Ice.Cloud.ProxyBase`1.CallWithCommunicationFailureRetry(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, RestRpcValueSerializer serializer)
at Ice.Cloud.ProxyBase`1.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
at Ice.Cloud.ProxyBase`1.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
at Ice.Proxy.BO.DynamicQueryImpl.GetList(DynamicQueryDataSet queryDS, QueryExecutionDataSet executionParams, Int32 pageSize, Int32 absolutePage, Boolean& hasMorePage)
at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass45_0.<GetList>b__0(DataSet datasetToSend)
at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func`2 methodExecutor, Boolean refreshQueryResultsDataset)
at Ice.Adapters.DynamicQueryAdapter.GetList(DynamicQueryDataSet queryDS, QueryExecutionDataSet execParams, Int32 pageSize, Int32 absolutePage, Boolean& hasMorePage)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.TestCallListBckg()
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.<>c__DisplayClass220_0.<BeginExecute>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Inner Exception
===============
Unable to cast object of type 'System.Boolean' to type 'System.String'.
At the present time, I don’t have any widgets connected in the function. If I connect to a Raise Exception widget, I get that instead of the invalid cast exception box, so I think I know the function is working okay, and that the problem is when it tries to export the “out” portion of the argument list. Or it errors when the BAQ tries to import the list. Or something.
I’ve checked the argument list on the EFx widget in the BPM against the input and output lists on the function multiple times. I don’t get a mismatch when validating the BPM or on execution–just the invalid cast.
I’ve seen Epicor try its best guess at telling you what the problem is, and sometimes it doesn’t get it right. Maybe that’s the problem here? Maybe just too many dang arguments?
I put the guts of the function inside the BPM and it works just fine, so I don’t think it’s really a cast issue.
Grasping.
Thanks,
Joe