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 :
Finance | Project Operations, Human Resources, ...
Answered

how to create Display fields

(0) ShareShare
ReportReport
Posted on by 680

Hi,

What is a display field and how can we create it? Does it have something to do with a display method we create in a table and tie it to a form control?

Additionally, when do we usually use them? 

Thank you. 

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    A display field is a field that displays a result of a display method.

    You create it by adding a field on your form, and setting DataSource and DataMethod properties to point to a display method on your table, or form data source.

    They are used to display data that is based on calculations, and/or not directly available in the form data sources.

    docs.microsoft.com/.../using-the-display-method-modifier

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    For an example of display method, you can take an example of CustTable\name method. The customer name is stored in DirPartyTable. This display method queries and fetches the name. This can be used on a form or on a custom lookup.

  • WillWU Profile Picture
    22,363 on at

    Hi ShawnDEV,

    Display field is the field whose value comes from display method.

    You can extend your form to create the display method , e.g.

    public static class PurchTable_Extension
    
    {
    
    [SysClientCacheDataMethodAttribute(true)]
    
    public static display PurchReqId PurchReqId (PurchTable _this)
    
    {
    
    PurchReqTable PurchReqTable;
    
    select PurchReqTable
    where PurchReqTable.PurchId == _this. PurchId;
    return PurchReqTable.PurchReqId;
    
    }
    
    }

    Then create a control in the form design and set the following properties to tie the method:

    Data source: PurchTable

    DataMethod: PurchTable_Extension::PurchReqId

    CacheDataMethod: Yes.

    See:anithasantosh.wordpress.com/.../

  • ShawnDEV Profile Picture
    680 on at

    Hi

    I thought that we could create a table extension first and then add a display method in there without having to add decorations like  “ExtensionOf” attribute. Then create a form extension and add a string control and tie the display method to it.

    But in WILL WU's response, a new class has been created with decorations and the display method in that class is referred to a form extension.

    Would both be possible ways to do this?

    Thank you.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    The attribute decoration "ExtensionOf" is not mandatory for display method and the method itself is a static method. But you could use the same class for CoC on other methods for the table and it would be better to have one extension class for the table object.

  • Verified answer
    WillWU Profile Picture
    22,363 on at

    Hi ShawnDEV,

    In D365FO, you won’t be able to add the new method or modify the existing method to the standard table or to an extension table.

    If you want to make changes to an standard form (add display fields or modify display method), you have to use the extension class.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans