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

Modifying code on a form

(0) ShareShare
ReportReport
Posted on by

Hi, I'm new to 365FO  and  I need to modify the Look up method of a field on a form.

I believe that this is done through the Datasource->>Field --> Lookup Reference Method.

But I don't see how to access the code from visual studio.

Can anyone help?

Thanks in advance

I have the same question (0)
  • Tony Wan Profile Picture
    210 on at

    One way to customise the lookup is the form handler, this is an example Class > DocuTemplateUploadDialogEventHandlers

    If you one the latest platform, then you could use the CoC to extend the Form control lookup method

  • brianmaric Profile Picture
    on at

    I have Installed product version : Finance and Operations (10.0.6)

    Does that include Coc?

    Thanks

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

    Yes.

  • Blue Wang Profile Picture
    on at

    Hi Brianmaric,

    CoC from the platform update 9 of Dynamics AX for Operations.

    https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/272325/what-is-chain-of-command-in-d365fo

  • brianmaric Profile Picture
    on at

    I am trying to set the field value on the form to some other field value.

    I am call the forms data source, but I don't see how to refer to particular fields

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

    You refer to it with data source name and field name. For example MyDataSource.MyField = MyValue. How to get the data source depends on your scenario, which we don't know.

  • brianmaric Profile Picture
    on at

    This code give me an error: "the parameter profile does not match the original method"

    [ExtensionOf(formdatafieldstr(SalesTable,SalesTable,SiteSalesManager))]
    Final class NTS_TestDataSource_Extension
    {
    public void LookupReference()
    {

    SalesTable SalesTable;
    FormDataSource SalesTableDS;
    FormDataObject SalesTableDataObject;

    SalesTableDataObject = any2Object(this) as FormDataObject;

    next LookupReference();

    SalesTableDS = SalesTableDataObject.datasource();


    }

    }

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    Which line of code gives the error? Does the underlying lookupReference have some parameters? CoC method must have the same parameter profile than the underlying method.

  • brianmaric Profile Picture
    on at

    It is this line..

      public void Lookup()

  • brianmaric Profile Picture
    on at

    Looks like it takes (FormReferenceControl _formReferenceControl) as an argument

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

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans