Line Amount not calculating even after setting salesLine.LineDisc = discountValue

I'm trying to create Sales Line from code but the Line Amount keeps defaulting to  => this.PriceUnit * this.SalesQty

Here is my formula:

salesLine.LineAmount = (this.PriceUnit * this.SalesQty) - this.LineDisc;
What am i doing wrong?
Parents Reply
  • You said the standard calculation works fine and also that LineAmount is not calculating. I'm not sure how I should understand it.

    I mean this works fine when I go through the Sales Orders list page and drills down on the Sales Order and then clicks on the "Add line" on the sales line grid to add a sales line

    You forgot to attach a tag with your version of AX. It is a good guess that you mean SalesOrderLineV2Entity in D365FO when you talk about SalesLineV2?

    I'm on D365 F&O, Yes I mean SalesOrderLineV2Entity.

    Microsoft needs to do better with examples on how to consume these OOB data entities, it can be really really frustrating when you're trying to call the endpoint and its not just working...

No Data