R28369 SalesOrder - Check Customer Location Validity

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

If (ShipToCustomer != null)

{

(DocumentDate >= ShipToCustomer.FromDate && DocumentDate <= ShipToCustomer.ThruDate)

||

(ShipToCustomer.FromDate == null && DocumentDate <= ShipToCustomer.ThruDate)

||

(DocumentDate >= ShipToCustomer.FromDate && ShipToCustomer.ThruDate== null)

||

(ShipToCustomer.FromDate == null && ShipToCustomer.ThruDate == null)

}
Description The customer locations has their own customer terms and conditions and these conditions are valid for specified period. If the they expire the user cannot sell to the specific location anymore by the same conditions. There is a need for new conditions. For example a customer location is part of specific price list for a season and then we revise his activity and there is a chance to change his terms and conditions. While the has no specified terms and conditions we cannot sell him anything as there is knowledge which prices to use and more.

The validity of the customer location's term and conditions are not mandatory and the fields may be null - From Date and/or Thru Date.
Message Customer location {ShipToCustomer.Party.PartyName} has no valid client conditions. The sales order document date is {SalesOrder.DocumentDate} and the customer location's conditions are valid from ({ShipToCustomer.FromDate}) thru ({ShipToCustomer.ThruDate}). Change the document date or update the customer location's conditions.
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.