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, ...
Answered

How to get the datasource value from extending Form method in D365 FO using COC

(0) ShareShare
ReportReport
Posted on by 52

Hi All,

I am creating a validation logic in VendEditInvoice form every time it calls the refresh method. I have created an extension of form method. My question now is that how can I can the datasource and active table records so I can perform the validation logic based from the current records of the datasource of this form. 

Here is my initial code.

[ExtensionOf(formStr(VendEditInvoice))]
final class VendEditInvoiceFormRefresh_Extension
{
public void refresh()
{

           next refresh();

           //how to get the value of the datasource or table records of the form??
}

}

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Simply refer to the data source by its name, such as vendInvoiceInfoTable.

    By the way, please always use Insert > Insert Code to paste source code. It will look this way:

    [ExtensionOf(formStr(VendEditInvoice))]
    final class VendEditInvoiceFormRefresh_Extension
    {
    	public void refresh()
    	{
    		next refresh();
    
    		//how to get the value of the datasource or table records of the form??
    	}
    }

  • knives1991 Profile Picture
    52 on at

    Thanks Martin, and noted on the paste source code part.

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 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans