Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to get data source...
Finance forum
Suggested answer

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

Posted on by 210

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

  • Suggested answer
    RE: How to get data source from data method in the form?

    You can use this :

    DataSource_ds replace datasource with the name of table

    exemple to get current cursor :

    DataSource dataSource = DataSource_ds.cursor();

  • MATTGUO Profile Picture
    MATTGUO 22,296 on at
    RE: How to get data source from data method in the form?

    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();

    }

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,513 Super User on at
    RE: How to get data source from data method in the form?

    Hi Vikash,

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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,513 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans