21 June 2019

How to access form data source using Form control in the event handler in D365 or AX7

How to access form record using Form control in the event handler in D365 or AX7

[FormControlEventHandler(formControlStr(InventJournalTransfer, Functions), FormControlEventType::Clicked)]

public static void Functions_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        InventJournalTrans      inventJournalTrans;
        InventJournalTable      journalTable;

        FormRun form = sender.formRun();
        FormDataSource journalTable_ds  =       form.dataSource(
        formDataSourceStr(InventJournalTransfer,InventJournalTable)) as FormDataSource;
        journalTable                   = journalTable_ds.cursor();

    }

No comments:

Post a Comment

Give me the commetns and solutions

Service class to get the selected record and deleted matching records and refresh the form data source in D365 F&O

 [DataContractAttribute] class ABCUserProfilesBulkDeleteContract {         UserId userId;     [DataMemberAttribute('UserId')]     pu...