web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Form fields calculation

(1) ShareShare
ReportReport
Posted on by 406
Hi, on my customized form, i have 2 tabs, quotation line and quotation lines details, i want the sum of the field Unit price to show on the total amount. also note that each field is in different data source. how this can be done ? where and which method should be overrided?
 
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,271 Super User 2026 Season 1 on at
    Hi D365FO developer,
     
    What is the type of total amount, is it display method or field?
     
    If it's a normal field:
    When you first open the form, you would like to see the sum of unit price, so you need to override the init method and calculate the sum for unit price lines
     
    You also would like the total amount to be amended whenever someone changes the unit price, so you need to override the modified method of unit price to recalculate the total amount
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • D365FO DEV Profile Picture
    406 on at
    hi Layan,
     
    thanks for your reply.
    the total amount field is of type Real.
    also theres no init method to override neither on the table nor form level.
    theres the init value method. 
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,809 Super User 2026 Season 1 on at
    Hi @D365FO ERP Developer,
     
    You must use a Display Method to calculate the total amount based on unit price.
     
    e.g.
    public display Name TotalAmount()
    {
        Table   table;
        select sum(UnitPrice) from table where ...
        return table.UnitPrice;
    }
     
    Best regards,
    Mohamed
  • D365FO DEV Profile Picture
    406 on at
    Hi @Mohamed,
     
    One issue is that i need to auto refresh the page, so  the total amount gets updated.
    i created a display method on the table, then attached this method on the field total amount on the form level under data method.
    calculation is correct but the total amount is not getting updated if i do not refresh the page.
    why?

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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Subra Profile Picture

Subra 370

#3
Martin Dráb Profile Picture

Martin Dráb 283 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans