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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to get data source from data method in the form?

(0) ShareShare
ReportReport
Posted on by 210

How to get data source from data method in the form?

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi Vikash,

    Can you please elaborate on your question? What is the business requirement you want to fulfill?

  • MATTGUO Profile Picture
    22,349 Moderator on at

    Hi vikash,

    You can use like that.

    This is an example of an EventHandler using modify OnModified event.

    [FormDataFieldEventHandler(formDataFieldStr(InventTransferOrders, InventTransferLine, QtyTransfer), FormDataFieldEventType::Modified)]

    public static void QtyTransfer_OnModified(FormDataObject sender, FormDataFieldEventArgs e)

    {

          FormRun formRun=sender.datasource().formRun();

    FormDataSource inventTransferLine_ds = formRun.datasource(‘yourdatasourcename’);

    InventTransferLine inventTransferLine = inventTransferLine_ds.cursor();

    inventTransferLine .initvalue();

    }

  • Suggested answer
    Mahmoudi Mohamed Amine Profile Picture
    30 on at

    You can use this :

    DataSource_ds replace datasource with the name of table

    exemple to get current cursor :

    DataSource dataSource = DataSource_ds.cursor();

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans