R28358 SalesOrder - Sales Return Allowed Directions

Code R28358
Entity Crm.Sales.SalesOrders Entity
Name SalesReturnAllowedDirections
Attribute -
Layer Back-End
Events Planning +
Modify NO
Action Validate that:

If (SalesOrder.SalesOrdersOptions.AllowedDirections == AllowedDirections.SalesReturn) All(*).SalesOrderLines.LineAmount <= 0 && All(*).SalesOrderLines.Quantity <= 0
Description Each specific sales order type may be set to support different type of rows (see Sales order row types). The need of such restriction may origin from various reasons - for example the generation procedures which are set in the sales order type may be selected only for returning goods and these settings may not be applicable if we are processing normal goods or services sales rows.

The 'Sales Return' option requires all rows of the document to have Quantity <= 0 and LineAmount <= 0.
Message The allowed directions setting for document '{DocumentText}' is set to 'Sales return' but there are lines in the document that do not return products or services. Delete those lines or edit them so that they become sales return lines.
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.