Thursday, 3 October 2019

REFRESH CALLING FORM IN DYNAMICS AX 7 x++ CODE REFRESH PARENT FORM

||REFRESH PARENT FORM on CLOSING THE CHILD FORM ||
Many times we get the requirement to refresh the main parent form or the calling form to be refreshed once the called form or the child form is closed,
Below code needs to be written on the child form method in order to do the same.

public void close()
    {
        FormRun formRun;
        FormDataSource  formDatasource;

        super();

        // Get an instance of the calling form.
        formRun = element.args().caller();
        if(formrun)
        {
            formrun.doResearch(); // Force all parent form data sets to refresh
        }
    }

Thanks,
Vikas Mehta

1 comment:

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++  Introduction In our previous posts, we explored what Copilot can do o...