Search This Blog

Saturday, September 3, 2022

Refresh the caller datasource of form using x++ in Dynamics 365 F&O

 Refresh the caller datasource of a form from class

Sometime, we have requirement that after completion of the certain process we need to refresh the caller form or may be we need to execute the query of the caller form. 

You can use the below code to refresh the caller datasource. 

There are many method or combination of the method of the datasource you can execute. So it is all based on the customer requirement

internal final class FOTestAccessCallerRecord extends Runbasebatch

{

    public static void main(Args    _args)

    {

        if (_args.caller() && _args.dataset() == tableNum(CustTable))

        {

            FormDataSource fds = FormDataUtil::getFormDataSource(_args.record());

            //you can use the various method over here like execute query or combination of the reread and refresh or if you wanted to execute the currenct query of the caller form

            fds.research(true)

        }

 

 

    }

 

}


No comments:

Post a Comment