Monday, 17 July 2023

How to: Refresh the Calling Form after Dialog Form action.


It is a very common scenario, where we need to refresh the data of a calling from, when you open a dialog or drop dialog.

To achieve this, we need to Override the CloseOk method of the Dialog form. below is the code for the same.

public void closeOk()

    {

        FormRun formRun;

        List dsList;

        ListEnumerator dsListEnumerator;

        FormDataSource formDS;


        super();


        // Get an instance of the calling form.

        formRun = element.args().caller();


        // If the caller is a form, find and refresh the specified root data source.

        if(formRun)

        {

            dsList = formRun.rootFormDataSources();


            if(dsList && dsList.elements() > 0)

            {

                dsListEnumerator = dsList.getEnumerator();


                while(dsListEnumerator.moveNext())

                {

                    formDS = dsListEnumerator.current();

                    formDS.research(true);

                }

            }

        }

    } 

No comments:

Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++

  Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...