R28290 SalesOrder - Null Historic Unit Cost When Product Is Not Stocked

Code R28290
Entity Crm.Sales.SalesOrders Entity
Name NullHistoricUnitCostWhenProductIsNotStocked
Attribute Line.HistoricalUnitCost
Layer Back-End
Events Planning +
Modify NO
Action for every line validate that:

if ((Quantity < 0 || LineAmount < 0) && Product.ProductType.IsStocked == False)

HistoricalUnitCost == null
Description A SalesOrder line is considered as returning of a service when the line amount or the quantity are negative and the product is not stocked.

The HistoricUnitCost field is used only for goods which are stocked and we can return in the store.

So when a service is returned, the HistoricUnitCost is null.

For more information see Sales order row types.
Message Line {LineNo} in '{DocumentText}' is considered to return services (because it has negative quantity or amount and the product in it isn't stocked) but column 'Historical_Unit_Cost' has value. 'Historical Unit Cost' is used only when the product in the line is stocked. Clear the value in 'Historical Unit Cost' for this line.

Sort Messages By Attribute: LineNo
Introduced In Version 2018
Revocable NO

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.