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

subtotal in purchtablelistpage form

(1) ShareShare
ReportReport
Posted on by 123
hello everyone,
 
I am trying to add subtotal column in the purchtablelistpage form, 
i have added the code like this, but it was showing the subtotal only for existing purchase order, 
 
[ExtensionOf(tableStr(PurchTable))]
public final class ABCPurchTable_Extension
{
    Display PurchLineAmount SubTotal()
    {
        PurchTotalsSummary   pts;
        ;
        select pts where pts.PurchId == this.PurchId;
        return pts.NetLines;
    }
}
 
what changes should be done if we want subtotal for newly created purchase order for all order status
  • Suggested answer
    Layan Jwei Profile Picture
    7,727 Super User 2025 Season 1 on at
    subtotal in purchtablelistpage form
    Hi M_R,
     
    So you want the total for all purchOrders and not just the current purchase order?
    If that's the case, your code won't work because in the where condition you are saying where pts.PurchId = this.PurchId -- which means it will give the total for only this PurchId
     
    If you need the total for all PurchIds then you need to use the keyword "count"
     
    Select count(FieldYouWantToCount) from Table1
     
    Thanks,
    Layan Jweihan

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,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans