R28122 Invoice - Automatic Order Linking
Code | R28122 |
Entity | Crm.Invoicing.Invoices Entity |
Name | AutomaticOrderLinking |
Attribute | - |
Layer | Back-End |
Events | First Releasing |
Modify | YES |
Action | For every line:
If "Invoice. AutomaticOrderLinking == true" and "InvoiceLine.InvoiceOrderLine == NULL", then find the InvoiceOrderLine corresponding to the current InvoiceLine and set its Id in the field "InvoiceLine.InvoiceOrderLine". The corresponding InvoiceOrderLine is determined as follows: 1.If "InvoiceLine.ParentSalesOrderLine = Null", the validation throws an error. 2. If "InvoiceLine.ParentSalesOrderLine" has value, then find all Lines from all non-voided InvoiceOrders with a document state at least Released that refer the current InvoiceLine. 3. If the count of the lines determined in the previous step is > 1, then throw an error. 4. For the determined line: if "InvoiceOrderLine.Product != InvoiceLine.Product", then throw an error. 5. For the determined line: if "InvoiceOrderLine.QuantityBase != InvoiceLine. QuantityBase", then throw an error. 6. If all of the above is completed without throwing an error, then set the Id of the determined "InvoiceOrderLine" in the field "InvoiceLine. InvoiceOrderLine". |
Description | The filed "Automatic Order Linking" specifies whether to automatically set the Invoice Order Line by searching invoice orders upon first release. If the check mark in the field is set, the current rule completes the search. If all of the conditions described in the "Action" section are fulfilled and the validation does not throw an error then the rule sets the determined invoice order line in the field "Invoice Order Line". |
Message | The messages according to the steps in the "Action":
Step 1: "The field 'Parent Sales Order Line' in line number '{InvoiceLine.LineNo}' is empty. The document is marked for „Automatic Order Linking" but the field 'Parent Store Order Line' in the line does not have a value. Please fill in a parent sales order line and try again." Step 3: "More than one invoice order lines. The document is marked for „Automatic Order Linking" but for line number '{InvoiceLine.LineNo}' are found more than one invoice order lines. Please void the unnecessary lines and try again." Step 4: "The product in the invoice line and the invoice order line is not the same. The document is marked for „Automatic Order Linking" but the product in line number '{InvoiceLine.LineNo}' in not the same as the product in the invoice order line. Please unify the product and try again." Step 5: "The base quantity in the invoice line and the invoice order line is not the same. The document is marked for „Automatic Order Linking" but the base quantity in line number '{InvoiceLine.LineNo}' in not the same as the base quantity in the invoice order line. Please unify the base quantity and try again." Sort Messages By Attribute: LineNo |
Introduced In Version | 2018.1 |
Revocable | NO |
* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.