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

Add new method in datasource of the extension form?

(0) ShareShare
ReportReport
Posted on by 15

Hello Guys, a the simple question.

I need add new method in the datasource of the extension form. it´s possible? 

I have searched various forums but have not found the answer to the question. To clarify, I don't want to override any method, I want to add a custom method.
I'm sorry if the question is basic, but honestly I'm new and I don't know how to do it.

From already thank you very much.

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi,

    Yes, you can add it via COC of form DataSource.

    [extensionof(formDatasourceStr(formName,DataSourceName))]
    Internal final class FormName_Extension
    {
        public void method1()
        {
            //you can call this method anywhere using datasource buffer. Dont look for Intellisense to show the
            custom method. Just type in the method name and it will work.
        }
    }

    Thanks,

    Girish S.

  • Angel Profile Picture
    15 on at

    I have added a method from the extension.

    [ExtensionOf(formStr(TaxTmpWorkTrans))]
    final class NXRTaxTmpWorkTransFrm_Extension
    {
        Display String30 displayMethod(TmpTaxWorkTrans _TmpTaxWorkTrans)
        {
            return TaxTable::find(_TmpTaxWorkTrans.TaxCode).field;
        }
    
    }

    but when I call it from the properties of the datamethod in my form control, it tells me that the method does not exist.

  • Suggested answer
    Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at

    Hi Angel, 

    Display method should rather be written on the table extension. 

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