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, ...
Suggested Answer

Can I create display method with parameters on class extensions

(0) ShareShare
ReportReport
Posted on by 44

Hi,

When I want to create class extension for displayExchRate  in CustInvoiceTable, i got this error. 

"Display methods can take only optional arguments, other than the first argument which can be a table."

display CustExchRate displayExchRate(date _date)
{
#isoCountryRegionCodes
CustExchRate s;
;

s = next getExchRate(_date);

return s;
}

Thanks in advance,

Best regards,

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

    Hi Oguzhan,

    You won't create display method with parameters other than tables as an argument. Also adding an argument is possible when you add display method at form DataSource level. Table level display method doesn't take any arguments.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, In this case, Pre or Post event handler will work.

    [ExtensionOf(tableStr(CustInvoiceTable))]
    public final class CustInvoiceTable_T_Extension
    {
        /// 
        ///
        /// 
        /// 
        [PostHandlerFor(tableStr(CustInvoiceTable), tableMethodStr(CustInvoiceTable, displayExchRate))]
        public static void CustInvoiceTable_Post_displayExchRate(XppPrePostArgs args)
        {
            Date dateLocal = args.getArg('_date');
            //Add Logic
    
            args.setReturnValue(dateLocal);
        }
    }
    

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 565 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