Monday, December 7, 2020

Passing Values to Data contract class in AX7/ D365 fo

 

Hi guys, Today we see how to Pass Values to Data contract class in AX7/ D365 fo.


I am passing the values from 'From Clicked method' to 'Data contract class' by Controller Class. 

Check the below example:


void clicked()

{

    SysOperationController            controller;

    SysOperationDataContract          dataContract;


    controller = new SysOperationController();


    controller.parmLoadFromSysLastValue(false);

    controller.parmExecutionMode(SysOperationExecutionMode::Synchronous);

            //controller.getDataContractObject()//// for sys operation     //controller.parmReportContract().parmRdpContract()

    dataContract = controller.getDataContractObject('_contract'); // In service class in processOperation method we are declaring  DataContact as Variable. That variable buffer we have to declare here. Method Signature Ex: public void processOperation(SysOperationDataContract  _contract)


    dataContract.parmCustAccount(CustTable.AccountNum);// passing value


    controller.startOperation();

}

Getting caller Record in Sys Operation Click Here.

Keep Daxing!!

No comments:

Post a Comment