Sunday, August 28, 2022

Get caller datasource, click button closeOK in form CustOpenTrans, get caller record of form LedgerJournalTrans for D365FO

 class CustOpenTrans_form_Exthandler

{


    [PostHandlerFor(formStr(CustOpenTrans), formMethodStr(CustOpenTrans, closeOk))]

    public static void CustOpenTrans_Post_closeOk(XppPrePostArgs args)

    {

        FormRun sender = args.getThis();

        CustTransOpen custTransOpen = sender.dataSource(formdatasourcestr(CustOpenTrans, CustTransOpen)).cursor();


        LedgerJournalTrans ljt = sender.args().record();

        info(strFmt('Voucher: %1', ljt.Voucher ));

    }


}

No comments:

Post a Comment