Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Form data field event ...
Finance forum
Suggested answer

Form data field event handler

Posted on by 305

Hi,

I am using form data field event handler. Here how can i call data source methods and form methods. please suggest me.
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormDataFieldEventHandler(formDataFieldStr(PurchTable, PurchLine, itemBarCode), FormDataFieldEventType::Modified)]
public static void itemBarCode_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource purchLine_ds = sender.datasource();
PurchLine purchLine = purchLine_ds.cursor();

}

Thanks,

  • Sukrut Parab Profile Picture
    Sukrut Parab 71,643 Moderator on at
    RE: Form data field event handler

    Did you check if you have proper references ? Is your problem resolved?

  • Prabakaran.R Profile Picture
    Prabakaran.R 305 on at
    RE: Form data field event handler

    Hi Sukrut,

    Thanks for your reply, It is a standard method only.

    Thanks,

    Prabakaran R.

  • Sukrut Parab Profile Picture
    Sukrut Parab 71,643 Moderator on at
    RE: D365 Form data field event handler

    Do you have proper  references  set to your model? Method you are calling is standard so I think references are not set  properly.

  • Prabakaran.R Profile Picture
    Prabakaran.R 305 on at
    RE: D365 Form data field event handler

    Hi Sukrut,

    Thanks for your suggestions, But it is not working I tried like that

    sender. formmethods and same way purchline.datasource method unfortunately am getting error like that. please suggest me anything i did wrong.

    " class does not contain method: the Purchline does not contain a definition for method itemidmodified and no extension method itemidmodified accepting a first argument of type purchline is found on any extension class".

    Thanks, 

    Prabakaran R.

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,643 Moderator on at
    RE: D365 Form data field event handler

    From sender you  can get formrun and call form method. You already got the formdatasource so you can call method from  datasource as well.

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,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans