问题
I'm using Data Import Export Framework in Microsoft Dynamics AX 2012 in order to export custom data (TestTable) from ax to file. I successfully did that.
Now I want to create a Batch job manually and then assign Batch job tasks for Staging job and Export job to execute this export in background. I don't know how to implement it, now I'm trying to create my own batch by duplicating Tutorial_RunbaseForm
class.
To learn how to set up execution jobs as batch jobs in AX I've started with Staging job:
Processing group > Get staging data > Create new job id > Select batch processing check box
and got the following infolog:
The Staging:ExportAXType-3 job is added to the batch queue.
In Processing group > Execution history
my job has waiting
status and when I click on the view staging data
Staging data shows nothing at this point.
In System administration > Inquiries > Batch job
I select my job and click on the View task
button then Parameters
button and an error is shown:
Cannot change a batch job that is not in the Withhold state
Update :
The export via batch don't work ,i found this error :
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeNewObjIntPtr(String typeName, IntPtr intPtr)
at Microsoft.Dynamics.Ax.Xpp.XppObjectBase.callReturn(KernelCallReturnVal returnVal)
at Microsoft.Dynamics.Ax.Xpp.DictTable.Makerecord()
at Dynamics.Ax.Application.DMFEntityWriter.writeToStaging(String _definitionGroup, String _executionId, DMFEntity entity) in DMFEntityWriter.writeToStaging.xpp:line 46
at Dynamics.Ax.Application.DMFStagingWriter.execute(String _executionId, Int64 _batchId, Boolean _runOnService, Boolean _calledFrom, Boolean , Boolean ) in DMFStagingWriter.execute.xpp:line 255
at Dynamics.Ax.Application.DMFStagingWriter.@execute(String _executionId, Int64 _batchId, Boolean _runOnService, Boolean )
at Dynamics.Ax.Application.DMFStagingWriter.execute(String _executionId, Int64 _batchId, Boolean _runOnService)
at Dynamics.Ax.Application.DMFStagingWriter.runOnServer(String _executionId, Int64 _batchId, Boolean runOn) in DMFStagingWriter.runOnServer.xpp:line 3
at Dynamics.Ax.Application.DMFStagingWriter.Run() in DMFStagingWriter.run.xpp:line 22
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)
来源:https://stackoverflow.com/questions/32950361/dynamics-ax2012how-to-export-data-using-runbasebatch