web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Get DataSource on Form...
Finance forum

Get DataSource on FormDatasourceField of other datasource event Handler in D365 FO

(0) ShareShare
ReportReport
Posted on by 210

Hi,

I have created one event handler of formdatasource field modified and I want to access other datasources in this event handler.

So can any one help me how to access other datasource in this event.

Like

 [FormDataFieldEventHandler(formDataFieldStr(VendEditInvoice, VendInvoiceInfoLine_Project, STProjTable), FormDataFieldEventType::Modified)]
    public static void STProjTable_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
    {

   }

in this event handler I want to access VendInvoiceInfoline_DS()

Thanks

  • Verified answer
    Jie G Profile Picture
    Microsoft Employee on at

    Hi Nikita,

    You can use sender.datasource().formRun() to get the FormRun object in the event handler.  Then get the datasource of the formRun object.

    sender.datasource().formRun().dataSource("VendInvoiceInfoLine");

  • Suggested answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    You can get it from the sender . Did you try that ?

    for example

    FormDataSource MyRandomTable_ds = sender.dataSource(formDataSourceStr(SomeForm, MyRandomTableDS)

    or

    FormDataSource projTable_ds = sender.formRun().dataSource("ProjTable");

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans