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

Override Sales Order Trade Agreement Line Discount With Highest Discount %

(3) ShareShare
ReportReport
Posted on by 183
Hi,
 
I have the following scenario.
 
The client has Line Discount Trade Agreements configured for customers.
 
For a single customer there could be multiple Line Discount TA's configured for the same item and well as inventory dimensions, the only difference being the applicable date and the discount %.
 
Some customers also have a combination of All, Group and Table codes with various discount % and they could all be "active" at the same time
 
For the most part the discounts are created with "Find Next" = false.
 
Standard FO will use the All > Group > Table hierarchy to find an applicable discount and will mostly settle on the lowest discount value depending on this hierarchy and whether or not "Find Next" is true or false as well as the price attribute combination rank.
 
My requirement is to override this logic at sales line creation and find the single highest applicable discount % regardless if this value falls under All, Group or Table.
 
I have had a look at the logic in SalesLine.SetPriceDisc and the subsequent call stack but I am unsure where exactly to add logic to override this safely...
 
If anyone has had this requirement or could offer some guidance it would be greatly appreciated.
 
Thank you in advance.
Categories:
I have the same question (0)
  • Suggested answer
    sagar_patil Profile Picture
    918 Super User 2025 Season 2 on at
    Hi,
     
    Did you check this?
     
     
    Here select MAX(Line,Multiline)
    The system considers both the calculated line discount and the multiline discount and applies only the better of the discounts.
     
     
    Note: Please help verify answer(s) if they guide you in right direction so other community members can also benefit from your question with verified answer.
     
  • Justin Kruger Profile Picture
    183 on at
    Hi Sagar,
     
    Thank you for your reply.
     
    I did look at those parameters yes and I did a test with your suggested parameter of MAX(Line,Multiline). In my scenario no multiline discounts exist and the line discount calculation stayed the same. It did not apply the highest line discount. I believe that parameter just selects the MAX between Line and Multiline, if both discount types exist, it does not necessarily select the highest from only line discounts
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at
    Hi Justin,
     
    I'm not fully sure if you are looking for having the most expensive price option for a customer or the lowest price/highest discount. The title and text is a bit confusing to me.
     
    The pricing engine searches with a priority on Table, Group, and All. In case Find next is set to false, it stops searching for other prices. In case this field is set to yes, it will continue searching and it will select the lowest price option. 
  • Justin Kruger Profile Picture
    183 on at
    Hi Andre,
     
    Thank you for your reply.
     
    My apologies for the confusion, please allow me to clarify the requirements with the below examples.
     
    Please consider the below line discount examples posted for a customer.
     
    Example 1:
     
    There are 3 active discounts for a combination of Table and Group product code types.
     
    Item ALSBABYH belongs to line discount group 0019 and Find Next is True on all lines.
     
     
    Due to Find Next being True on all lines the resultant sales order line compounds the discount percentage, resulting in a discount of 50%

     
     
    Example 2:
     
    There are 3 active discounts for a combination of Table and Group product code types.
     
    Item ALSBABYH belongs to line discount group 0019 and Find Next is False on all lines.
     
     
     
    Due to Find Next being False on all lines the price engine finds the first applicable discount and stops, the result being the lowest discount of 10% is awarded.

     
    In both of these examples the expectation is that the single highest discount should be applied that being 25%, regardless of the All > Group > Table hierarchy and of the state of the Find Next flag.
     

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans