Home / Questions / Display Method in D365 F&O
Explanatory Question

Display Method in D365 F&O

👁 2,622 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Indicates that the methods return value is to be displayed on a forms (or) Reports. The value cannot be altered in the form or report

Take the new method in a table, and then drag that method into the grid and set data source properties. In that field is non-editable.

We can create display method on the

  1. Table methods
  2. Form methods
  3. Form data source methods
  4. Report methods
  5. Report design methods

Display Name names ()
{
    CustTable   custTable;
    ;
    return  CustTable::find(this.CustAccount).Name;
}

Here is another example of Display Method

Below method is part of AnsariMCROrderEventTable_Extension which is table extension.


/// <summary>
/// Extension methods for the <c>MCROrderEventTable</c> table
/// </summary>
[ExtensionOf(tableStr(MCROrderEventTable))]
final class AnsariMCROrderEventTable_Extension
{
 // 22/01/2021 - rummanansari -  CR no - Include Time zone on SO time stamps and Route cutoff times - Start
    [SysClientCacheDataMethodAttribute(true)]
    public display Timezone ANSARITimeZone()
    {
        SalesTable salesTable;
        TimeZone warehouseTimeZone;

        select InventSiteId from salesTable where salesTable.SalesId == this.SalesId;

        warehouseTimeZone = InventSite::timeZoneSite(salesTable.InventSiteId);
        return  warehouseTimeZone;
    }
    // 22/01/2021 -  rummanansari -  CR no - Include Time zone on SO time stamps and Route cutoff times - End
}

Another Example of Display Method

This method is the part of the ansariSalesTable_Extesnion, which is table extension.


   // 22/01/2024 - rummanansari -  CR no - Include Time zone on SO time stamps and Route cutoff times - Start
    [SysClientCacheDataMethodAttribute(true)]
    public display Timezone ansariCutoffTimeandTimeZone()
    {
        TimeZone        warehouseTimeZone;
        warehouseTimeZone = InventSite::timeZoneSite(this.InventSiteId);
        return  warehouseTimeZone;
    }
    // 22/01/2024 - rummanansari -  CR no - Include Time zone on SO time stamps and Route cutoff times - End