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

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 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
    239,029 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans