web
You’re offline. This is a read only version of the page.
close
Skip to main content
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,036

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,434 User Group Leader on at
    RE: How To Get "Line Discount" Value in PO > Totals screen for an SSRS Report?

    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,036 on at
    RE: How To Get "Line Discount" Value in PO > Totals screen for an SSRS Report?

    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,036 on at
    RE: How To Get "Line Discount" Value in PO > Totals screen for an SSRS Report?

    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,036 on at
    RE: How To Get "Line Discount" Value in PO > Totals screen for an SSRS Report?

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans