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 27

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,

  • Suggested answer
    Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: Can I create display method with parameters on class extensions

    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);
        }
    }
    

  • Suggested answer
    GirishS Profile Picture
    27,823 Moderator on at
    RE: Can I create display method with parameters on class extensions

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,276 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,975 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans