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 / How to get the current...
Finance forum

How to get the current record using form modification method

(0) ShareShare
ReportReport
Posted on by 570

Hi All,

environment: D365

My requirement is based on a modification of the form field some process will perform. The question is used below code. How I get (or) pass the current record.

[FormControlEventHandler(formControlStr(VendEditInvoice, PurchParmTable_InvoiceAccount), FormControlEventType::Modified)]
public static void PurchParmTable_InvoiceAccount_OnModified(FormControl sender, FormControlEventArgs e)
{

Ex ample I need current Invoiceaccount record

}

BR

Tony

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    You can access anything on the form via sender.formRun(). Also current record of data source(s).

    Try with sender.formRun().dataSource... and see what's available. Once you get handle of the data source you can call dataSource.cursor() to get the current record.

  • TonyAx Profile Picture
    570 on at

    Hi Nikolaos,

    Thank for reply .Am new to D365 below diplay my code.Can you  please send how to get crrent invocie account number using    Send.FormRun().datasource

    [FormControlEventHandler(formControlStr(VendEditInvoice, PurchParmTable_InvoiceAccount), FormControlEventType::Modified)]

    public static void PurchParmTable_InvoiceAccount_OnModified(FormControl sender, FormControlEventArgs e)

    {

     //Send.FormRun().datasource

    }

    BR

    Tony

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    Do you mean you just want to have the value of the field where your event handler is, but not any record?

    Try sender.valueStr() to get it.

  • TonyAx Profile Picture
    570 on at

    Thank  you. I got output

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