Dynamics AX Blog - sysoperation-framework - Page 3
Calling a SysOperation-based function through codeIf you need to run a function - implemented by using the SysOperation-Framework - by code, the following job can show you how you can do this. static void runSysOperationThroughCode(Args _args) { TutorialSysOperationServiceController controller; TutorialSysOperationDataContract dataContract; SysOperationStartResult sysOperationStartResult; controller = TutorialSysOperationServiceController::newFromArgs(new Args()); dataContract = controller.getDataContractObject('_dataContract'); controller.parmExecutionMode(SysOperationExecutionMode::Synchronous); dataContract.parmFilenameSave(@"c: empmyFile.txt"); dataContract.parmCustAccount('US-006'); sysOperationStartResult = controller.startOperation(); } |
SysOperation: Open form with specific record after processingImagine the following scenario: You have to create or update a record using a clas, which extends Sysoperation-Framework. After this database operation you have to open a particular form, which allows the user to modify the just created/modified record. For such tasks i like to use the aferoperation()-method from the Controller-Class. By using the operationReturnvalue of the Service-Class within this method it is possible to process the record. |
AX 2012: SysOperation-Framework: Use your own form as a dialogIn have already described how you can integrate your own form as a dialog within the SysOperation framework. Meanwhile, I've encountered a much simpler version:
protected FormName templateForm() { FormName ret; ret = formStr(CopyOfSysOperationTemplateForm); return ret; } |
|
|
|
|
|
|
Anyone who has ever implemented a function using the SysOperation framework knows that creating the necessary (up to) four classes is some work.
lazyefficient contemporaries I have therefore developed the following job, with the help of this time-consuming work can be significantly shortened.In the job you have to set an "base name", which is used for naming the four classes (Controller, Dataprovider, UIBuilder and Service).
In addition there is a map called dataContractParmsMap from - unless you have inserted content in this map - matching parm methods are created when generating the data provider. In example job the map contains two entries for a customer account number and an item number.