Hi All,
I have created a custom script to be run in production environment. We have tested in lower environments like preprod and dev. There was no issue whatsoever. When the same script is being run in production. I get the below error.
[8/29/2025 11:54:08 am] Test run started
[8/29/2025 11:54:17 am] Exception has been thrown by the target of an invocation.
[8/29/2025 11:54:17 am] at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Dynamics.AX.Application.AppConsistencyCustomScriptFile.executeScript()
at Dynamics.AX.Application.AppConsistencyCustomScriptStateChange.runScript()
at Dynamics.AX.Application.AppConsistencyCustomScriptStateChange.process(Boolean _isTestRun)
[8/29/2025 11:54:23 am] SQL statement: UPDATE APPCONSISTENCYCUSTOMSCRIPT SET LOG='',RECVERSION=972777893,MODIFIEDDATETIME='2025-8-29',MODIFIEDBY='APP_D365_ADMIN02' WHERE ((RECID=5637173826) AND (RECVERSION=595582687))
[8/29/2025 11:54:23 am] SQL statement: UPDATE APPCONSISTENCYCUSTOMSCRIPT SET LOG='',RECVERSION=1691892766,MODIFIEDDATETIME='2025-8-29',MODIFIEDBY='APP_D365_ADMIN02' WHERE ((RECID=5637173826) AND (RECVERSION=972777893))
[8/29/2025 11:54:23 am] Completed