GuruGroup logo
Microsoft Dynamics 365 F&O Technical Guide

Display method and its alternative in Dynamics 365 F&O

Executive Summary & Key Architectural Takeaways
  • Dynamic Form Calculations: Using X++ display methods to compute and present calculated data on form grids and details tabs.
  • Client-Side Caching Optimization: Annotating display methods with [SysClientCacheDataMethodAttribute(true)] to prevent redundant RPC calls.
  • Grid Limitations of Display Methods: Display methods on form grids cannot be filtered or sorted natively, and introduce row-by-row rendering lag.
  • High-Performance View Alternative: Replacing expensive display methods with a SQL-backed AOT View joined directly to the form datasource.
  • Full Sorting & Filtering: Query-backed view columns provide native database indexing, multi-column sorting, and instant user grid filtering.

Overview: Adding Fields to the VendTable Form

In this article, we will learn how to add a calculated field to the VendTable form in Dynamics 365 Finance & Operations using two contrasting approaches: the traditional display method and the scalable alternative using a database view.

Navigation: Accounts payable > Vendors > All vendors

All Vendors Form Grid
Figure 1: Standard All Vendors form grid before customization.
VendTable Payment Tab
Figure 2: Vendor details payment fast tab.

“While display methods are quick to implement for header details, using them on high-volume grids degrades performance. Database views restore native indexing, sorting, and filtering.”

— Muhammad Hammad, Dynamics 365 Technical Consultant

Approach 1: Adding Field Using Display Method

Any method containing the display keyword as a modifier is an X++ display method. It calculates and returns values on the fly.

Step # 1: Create an extension of the table VendTable and define a cached display method:

[ExtensionOf(tableStr(VendTable))]
internal final class HMVendTable_Extension
{
    [SysClientCacheDataMethodAttribute(true)]
    public display Description vendDescription()
    {
        VendTable vendTable = this;
        return DirPartyTable::findRec(vendTable.Party).Name;
    }
}

Step # 2: In the VendTable form extension, drag the vendDescription display method from the datasource into your grid or tab page:

Dragging display method onto form
Figure 3: Binding the cached display method to the form extension design.
Display method output on vendor form
Figure 4: Display method output verified on the vendor form.

Approach 2: High-Performance Alternative Using View

The Problem with Display Methods on Grids: When users scroll through thousands of rows, the client must execute the display method for every single record, creating substantial network roundtrips. More critically, users cannot filter or sort on display method columns.

Architecture Comparison: Display Method vs. Database View
X++ Display Method on Form Grid Executed row-by-row at runtime. Sorting is disabled, grid filtering is impossible, and performance drops significantly on tables with large record counts.
AOT View Joined to Form Datasource Evaluated at SQL level via optimized inner/outer joins. Full native sorting, instant column filtering, and lightning-fast grid rendering.

Step # 1: Create a new AOT View querying the source table (e.g. DirPartyTable) and expose the required field:

Creating AOT View in Visual Studio
Figure 5: Creating an AOT View to retrieve party details.
View metadata and datasource
Figure 6: Configuring view fields and query datasources.

Step # 2: In the VendTable table extension, add a relationship linking VendTable.Party == YourView.Party:

Adding Table Relation on VendTable Extension
Figure 7: Adding table relation between VendTable and the custom View.

Step # 3: In the form extension, add the View as a joined datasource and drag the field directly into the grid:

View Field with Full Sorting and Filtering Enabled
Figure 8: View field rendering on the vendor grid with complete sorting and filtering active.
Ready to Move Forward?

Turn Your Business Goals into Measurable Results

Partner with Guru Group to design, deliver, and scale secure technology solutions for your organization.