Showing posts with label get DataSource from FormDataSourceEventHandler. Show all posts
Showing posts with label get DataSource from FormDataSourceEventHandler. Show all posts

Saturday, 19 September 2020

How to get DataSource object from FormDataSourceEventHandler

 DataSource object from FormDataSourceEventHandler


FormDataSourceEventHandler(formDataSourceStr(LedgerJournalTable, LedgerJournalTable), FormDataSourceEventType::Activated)]

public static void LedgerJournalTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)

    {

        LedgerJournalTable currentRecord = sender.cursor();

FormDataSource ledgerJournalTableDS = sender.formRun().dataSource(formDataSourceStr(LedgerJournalTransDaily, LedgerJournalTrans));

       }


Now from the ledgerJournalTableDS you can get the datasource instance.


Thanks,

Vikas Mehta.

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++

Blog Post 6: Bonus – Building Your First Custom Copilot Plugin in X++  Introduction In our previous posts, we explored what Copilot can do o...