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?
Related
Recommended