Monday, December 24, 2018

Refresh Caller form data source in AX 2012

Refresh Caller form data source:
Parent Form: POCVehicleForm
Child Form: POCInsurenceMaster

Write below code snippet on click method of button on POCVehicleForm

void clicked()
    MenuFunction        mf;
    Args                        args;

    args= new Args();

    mf=new MenuFunction(identifierStr(POCInsurenceMaster), MenuItemType::Display);;

Overwrite below method on POCInsurenceMaster:

 public void closeOk()
        FormRun formRun;
        // Buffer of calling form.
        formRun = element.args().caller();
        // Check if caller is form

Open POCInsurenceMaster from POCVehicleForm and once update record and close child form then parent form will be refreshed.

No comments:

Post a Comment