Hi.
I want to create a sales order via X code which lines have negative values on the SalesQty field.
I already have a class that creates the sales orders correctly with positive quantities, the problem comes when I try to create a line with a negative quantity, when I try to do It, I get the following messages:
"Quantity may not change sign." "Update has been canceled."
I am able to change the quantities of the already created SO lines to negative values correctly from the sales orders menu in the graphic interface, so how would I do It by code?
This is the code I tried:
SalesQty negSalesQty;
negSalesQty = -salesLine.SalesQty;
salesLine.LineAmount = salesLine.calcLineAmount();
salesLine.update();