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 :
Microsoft Dynamics AX (Archived)

How To Get "Line Discount" Value in PO > Totals screen for an SSRS Report?

(0) ShareShare
ReportReport
Posted on by 1,044

Hello awesome community! :)

In PO > Totals screen

Here is a screenshot:

3554.Capture.PNG

I want to know how can I get the value of "Line Discount" field.

I tried to use the "PurchTotals" Class using this guide:

https://community.dynamics.com/ax/b/daxbeginners/archive/2014/08/19/how-to-use-aot-query-through-x

but I didn't find a method that will get me the value of "Line Discount" field.

There is a "lineDisc()" method in the class but it gets me different value than the one in the screenshot above.

Your help will be apreciated!

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    You may want to use object of PurchTotals Class

    PurchTable      PurchTable;
        PurchTotals     PurchTotals;
        ;
        PurchTable= PurchTable::find('000037');
        if(PurchTable)
        {
            PurchTotals = PurchTotals::newPurchTable(PurchTable,PurchUpdate::All);
            PurchTotals.calc();
            info(strFmt('%1',PurchTotals.purchLineDisc()));
        }
        else
        {
            info('Invalid PO number');
        }
  • Momochi Profile Picture
    1,044 on at

    Hello Mr. Sohaib Thanks for your time and help!

    I tried what you mentioned but the the result it gave me was "37500" which I found is the double of what is shown in the screen "18750".

    I don't know why but is it safe to do:

    "    PurchTotals.purchLineDisc()/2;   "?

    Or is there a better way?

    Thank you!

  • Momochi Profile Picture
    1,044 on at

    Also I found a table called "PurchTotalsSummary"

    Which has most of the data of "Totals" screen.

    and I found it has a field called "LineDiscount" which has the correct data I need "18750".

    Is this table valid?

    Thanks!

  • Momochi Profile Picture
    1,044 on at

    Sorry, forget what I said above.

    My mistake, the reason it was showing 38500 instead of 18750 is because there was a mistake in the design.

    Your code is correct.

    Thank you for your help Mr. Sohaib! :)

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans