When triggered, the form is shown correctly, and I press a button. I immediately call a “Show Message” node and display <callContextBpmData.ButtonValue/> but I get this:
I tried to do the same BPM in Update, but the form does not show.
Ice.Common.EpicorServerException: Exception has been thrown by the target of an invocation.
—> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
—> Ice.Common.EpicorServerException: BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
—> System.NullReferenceException: Object reference not set to an instance of an object.
at Epicor.Customization.Bpm.BO.MasterUpdatePostProcessingDirective_CreateMiscCharge_9523C503A8324D1095E934E87DFFA170.A001_CustomCodeAction()
at Epicor.Customization.Bpm.BO.MasterUpdatePostProcessingDirective_CreateMiscCharge_9523C503A8324D1095E934E87DFFA170.ExecuteCore(Int32 step)
at Epicor.Customization.Bpm.DirectiveBase2.Execute() in C:\_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 330 at Epicor.Customization.Bpm.DirectiveBase2.Execute(TParam parameters) in C:_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 222
— End of inner exception stack trace —
at Epicor.Customization.Bpm.DirectiveBase2.Execute(TParam parameters) in C:\_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 222 at Epicor.Customization.Bpm.MethodCustomizationBase22.<>c__DisplayClass11_0.b__5(MethodDirectiveBase2 dir) in C:\_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\MethodCustomizationBase2.cs:line 188 at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Epicor.Customization.Bpm.MethodCustomizationBase22.RunDirectives(TParam parameters) in C:_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\MethodCustomizationBase2.cs:line 0
at Epicor.Customization.Bpm.CustomizationBase22.Execute(TParam parameters) in C:\_releases\ICE\ICE4.2.200.14\Source\Server\Internal\Lib\Epicor.Customization.Bpm\CustomizationBase2.cs:line 98 at Epicor.Customization.Bpm.BO.SalesOrderSvcCustomization.MasterUpdate(Boolean lCheckForOrderChangedMsg, Boolean lcheckForResponse, String cTableName, Int32 iCustNum, Int32 iOrderNum, Boolean lweLicensed, Boolean& lContinue, String& cResponseMsg, String& cCreditShipAction, String& cDisplayMsg, String& cCompliantMsg, String& cResponseMsgOrdRel, String& cAgingMessage, SalesOrderTableset& ds) at Erp.Services.BO.SalesOrderSvcFacade.MasterUpdate(Boolean lCheckForOrderChangedMsg, Boolean lcheckForResponse, String cTableName, Int32 iCustNum, Int32 iOrderNum, Boolean lweLicensed, Boolean& lContinue, String& cResponseMsg, String& cCreditShipAction, String& cDisplayMsg, String& cCompliantMsg, String& cResponseMsgOrdRel, String& cAgingMessage, SalesOrderTableset& ds) in C:\_releases\ERP\ERP11.2.200.14\Source\Server\Services\BO\SalesOrder\SalesOrderSvcFacade.cs:line 6783 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Ice.Hosting.RestApi.OperationInvokeHelper.<>c__DisplayClass23_0.b__0(Object obj) in C:_releases\ICE\ICE4.2.200.14\Source\Server\Framework\Epicor.Ice\Hosting\RestApi\OperationInvokeHelper.cs:line 401
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:\_releases\ICE\ICE4.2.200.14\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 77 at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:_releases\ICE\ICE4.2.200.14\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 47
— End of inner exception stack trace —
But small twist in the story. I added a Raise Exception node after the message node and I get the message with the code from the button. So perhaps the error is happening after the message node and just superseding the display of the button code message.