Error with extends Runbasebatch class .. a possible workaround …
Sometimes despite implementation of BOF Framework you could find to use the old Runbasebatch class (with implementation) and your implementation works fine during normal client but when you decide to run on batch obtain the following result
Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.
at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)
at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.doUpdate(IntPtr table)
at Dynamics.Ax.Application.<YOUR CLASS /METHODS>in <YOUR CLASS >
at Dynamics.Ax.Application.<YOUR CLASS /METHODS> in
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)
the best way it’s follow the suggestion of best developer and try to recompile / do incremental CIL and FULL CIL and so on
In some cases I solve change in the class declaration the parameter of version. This mean that you must change name of your internal variables but I see that sometimes works. See for information the example below
Original
class myclass extends RunBaseBatch { str htmlTitle; str htmlBody; str htmlTile; QueryRun queryRun; Email eMailTo; DialogField df_eMailTo; container ListNotified; container ListTableField; #define.CurrentVersion(1) #define.Version1(1) #localmacro.ContainerList eMailTo #endmacro }
New
class myclass extends RunBaseBatch { str htmlTitle; str htmlBody; str htmlTile; QueryRun queryRun; Email eMailRecipientTo; DialogField df_eMailTo; container ListNotified; container ListTableField; #define.CurrentVersion(2) #define.Version1(2) #localmacro.Recipient eMailRecipientTo #endmacro }
Obviuosly you must realign pack and unpack methods and where the variable is used after recompile anyway all (with final incremental CIL).
Bye.

This was originally posted here.
*This post is locked for comments