Hi all,
One of my event subscribers in NAV2016 is causing an unhandled exception.
As soon as the event is fired, I'm getting this exception in the client:
The NST event viewer:
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace:
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriber(NavEventSubscription subscriber, NavCodeunit subscriberCodeunitInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.ProcessCallToAllSubscribers(NavApplicationObjectBase callerApplicationObject, PrepareParametersCallBack prepareParameters)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.ValidateField(Action`1 fieldEvent, NCLMetaField metaField, Boolean isUserInput)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.Validate(NCLMetaField metaField, NavValue newValue, NavRecord callerRecord, Boolean isUserInput)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.Validate(NCLMetaField metaField, NavValue newValue, NavRecord callerRecord)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.CreateServItemLines_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.CreateServItemLines(INavRecordHandle ServRegHeader, INavRecordHandle vRecServHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.WizardFinish_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.WizardFinish(INavRecordHandle vRecServRegHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.FinishWizard_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.FinishWizard()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.Finish_a45_OnAction()
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2147467261
If I remove the subscriber, the issue is gone. As soon as I manually re-create it, it crashes again.
There is no code behind the validate of the field. And no real code in the subscriber (it even crashes with 'IF TRUE THEN;').
Any ideas?
One of my event subscribers in NAV2016 is causing an unhandled exception.
As soon as the event is fired, I'm getting this exception in the client:
The NST event viewer:
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace:
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriber(NavEventSubscription subscriber, NavCodeunit subscriberCodeunitInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.ProcessCallToAllSubscribers(NavApplicationObjectBase callerApplicationObject, PrepareParametersCallBack prepareParameters)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.ValidateField(Action`1 fieldEvent, NCLMetaField metaField, Boolean isUserInput)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.Validate(NCLMetaField metaField, NavValue newValue, NavRecord callerRecord, Boolean isUserInput)
at Microsoft.Dynamics.Nav.Runtime.NavRecord.Validate(NCLMetaField metaField, NavValue newValue, NavRecord callerRecord)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.CreateServItemLines_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.CreateServItemLines(INavRecordHandle ServRegHeader, INavRecordHandle vRecServHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.WizardFinish_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.WizardFinish(INavRecordHandle vRecServRegHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60015.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.FinishWizard_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.FinishWizard()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Page60015.Finish_a45_OnAction()
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2147467261
If I remove the subscriber, the issue is gone. As soon as I manually re-create it, it crashes again.
There is no code behind the validate of the field. And no real code in the subscriber (it even crashes with 'IF TRUE THEN;').
Any ideas?