I had a scenario where I had to call a new method in one of the fields from Vendor Payment Journal Line. The new method exists in Extension class of Vendor Payment journal.(which is a form method). This has to be called in modified method of the field ‘Ledger Dimension’. The steps are as follows [ExtensionOf(FormStr(LedgerJournalTransVendPaym))] final class LedgerJournalTransVendPaymFormExt_Extension { public void newMethod() { ………………. } } How do call this method in modified ? you have two choices – Create a event handler for the method or Chain of Commands. On using event handler, I ended up with error when I tried to call the new method using formRun. [FormDataFieldEventHandler(formDataFieldStr(LedgerJournalTransVendPaym, LedgerJournalTrans, LedgerDimension), FormDataFieldEventType::Modified)] public static void LedgerDimension_OnModified(FormDataObject sender, FormDataFieldEventArgs e) { FormDataSource ledgerJournalTrans_ds = sender.datasource(); FormRun ...
Dynamics 365 finance and operations articles