Thursday, 10 June 2021

D365 FO Refresh Called from after function call

 Hi All,

The below code will help you to refresh the call from after the data operations, for me I'm refreshing the PurchTable form after duplicating line from exiting lines.


 protected static  void updateCaller(PurchTable  _purchTable)

    {

        PurchTable  purchTable = _purchTable;//purchTable::find(PurchLine::findRecId(_args.record().RecId));

        Object callerPurchTableDataSource = FormDataUtil::getFormDataSource(purchTable);


        if (callerPurchTableDataSource)

        {

            callerPurchTableDataSource.reread();

            callerPurchTableDataSource.refresh();


            if (formDataSourceHasMethod(callerPurchTableDataSource, identifierStr(reReadLines)))

            {

                callerPurchTableDataSource.reReadLines();

            }

        }

    }


Thank you,

Keep Daxing :)

No comments: