Dynamics AX Blog - sysoperation-framework - Page 3

These posts are machine-translated.
Currently, only posts are displayed, which contain the tag »sysoperation-framework« Filter entfernen

Creating Sysoperation classes through code

Anyone who has ever implemented a function using the SysOperation framework knows that creating the necessary (up to) four classes is some work.

ScreenshotFor lazy efficient 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.


 
 

Calling a SysOperation-based function through code

If 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 processing

Imagine 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 dialog

In 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:

  • Create a copy of form SysOperationTemplateForm
  • Overwrite method templateForm() like the following snippet shows
protected FormName templateForm()
{
    FormName ret;

    ret = formStr(CopyOfSysOperationTemplateForm);

    return ret;
}

 
 
Pages « 1 2 3 

 

 
 
 
Posts of the actual month
März 2024
MoTuWeThFrSaSu
 123
45678910
11121314151617
18192021222324
25262728293031
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.