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

Display method on the view

(0) ShareShare
ReportReport
Posted on by 439

Hi All,

I am trying  to create a view and I have used the view as the datasource  of my form  but I want to use a display method 

I have seeen the example in the standard view "CustGrossMarginbyAccount_NA" how they have created a display method 

    display SalesContributionMarginMST contributionMarginMST()
    {
        SalesCostValue salesCostValue;

        salesCostValue = this.costValue();

        return this.LineAmountMST - salesCostValue;
    }

I have created a display method like below :

    display AmountMST remainAmountMST()
    {
        CustTrans CustTrans;

        CustTrans = CustTrans::find(this.RecId1);

        return CustTrans.remainAmountMST();
    }

then i have created a real field  and I have selected the view  and in the datasource 

31460.png

and it gives an error 

Severity Code Description Project File Line Suppression State
Error Path: [AxForm/CustTransOpenInvoice/Design/Controls/FormGrid/Controls/FormRealControl2/DataMethod:The data method 'remainingAmountMST' was not found on the data source 'CusttransOpenInvoice' or its base table/view. RentAndServices (VAR) [RentAndServices K:\AosService\PackagesLocalDirectory\RentAndServices\RentAndServices\AxForm\CustTransOpenInvoice.xml 0

display AmountMST remainingAmount()
{

AmountMST amount = CustTrans::find(CusttransOpenInvoice.RecId).remainAmountMST();
return amount;

}

Even I have created a display method in the datasource level  and it is not reflecting the correct value 

Kindly help I am using D 365 FO

  • Gunjan Bhattachayya Profile Picture
    35,429 on at

    Hi Rohit,

    The method name as per your code snippet is "remainAmountMST".

    The data method name on the control should be the same name. Right? From your screenshot, I can see it is "remainingAmountMST".

  • Verified answer
    Martin Dráb Profile Picture
    240,762 Most Valuable Professional on at

    The method in the last code snippet has yet another name remainingAmount() and it should accept a table buffer as a parameter; if it's written on a form data source.

    (Thread moved from Dynamics AX forum.)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 430 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 368

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 364 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans