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
  • Line amount is normally calculated by the systems from other fields - it seems that the standard calculation executes after your code. Or maybe it's updated by another customization?

    Why do you want to use your calculation instead of the standard one (which is more sophisticated)? Because something in your system has broken the standard calcuLATION and you're trying to calculate things by yourself instead of locating and fixing the actual problem?

Reply Children
Related
Recommended