Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Form data field event ...
Finance forum

Form data field event handler

(0) ShareShare
ReportReport
Posted on by 307

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
    71,682 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
    307 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
    71,682 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
    307 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
    71,682 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.

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,041 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,860 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans