Thursday, 17 February 2022

OnModified FormEventHandler in D365 FO

class NYXCustPaymEntryFormEventHandler

{

 [FormControlEventHandler(formControlStr(CustPaymEntry, NYXGlobalName), FormControlEventType::Modified)]

    public static void NYXGlobalName_OnModified(FormControl sender, FormControlEventArgs e)

    {

        FormdataSource      LedgerJournalTransDS = sender.formRun().dataSource(formDataSourceStr(CustPaymEntry, LedgerJournalTrans)) as FormDataSource;

        LedgerJournalTrans  ledgerJournalTrans   = LedgerJournalTransDS.cursor() as LedgerJournalTrans;


        ledgerJournalTrans.LedgerDimension = 0;

        LedgerJournalTransDS.object(fieldnum(ledgerJournalTrans,LedgerDimension)).modified();

    }

}

No comments:

Post a Comment

DefaultDimension in d365 FO X++

 Navigate to PurchTable methods you can find with DefaultDimension this.DefaultDimension = this.mergeDimension(this.getDefaultDimension(),th...