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

Stop Overwrite Prices and Discounts using code

(0) ShareShare
ReportReport
Posted on by

Hello,

I created a Sales Order through code. In the Sales Line I am setting a Unit Price which is different to Trade Agreement Price. It creates the sales order with the new assigned price.

But the problem is when I perform any operation on Sales Order it updates the unit price with the default Product price.

I know it has something to do with Trade Agreement Evaluation. Sales Line has a field ManualEntryChangePolicy but i don't know how to set this. Can someone tell me how to implement this manual change in code? 

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    These kind of issues are difficult to guess and it takes more to debug usually. For your issue, only hint I can provide you a Map named as SalesPurchLine.

    If you will search SalesPurchLine on following two objects you would find many times, the use of the Map (SalesPurchLine)

    1) \Data Dictionary\Tables\SalesLine

    2) \Classes\SalesLineType

    Basically the map named SalesPurchLine, contains lot of methods that effect pricing of your sales line.

    Sales Line price is such a sensitive subject that it can get change by many factors in AX/D365. I would certainly recommend debugging.

  • Verified answer
    Community Member Profile Picture
    on at

    Thank you Sohaib for reply.

    I read White paper on Trade Agreement Evaluation and got a bit of idea about this. Here is the link.

    And I resolved my issue by calling method
    Salesline.setPriceDiscChangePolicy(PriceDiscSystemSource::ManualEntry, fieldNum(Salesline, SalesPrice));

    and it set the ManualEntryChangePolicy and I guess it breaks the link of sales price with Trade agreement.

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans