R32687 LogisticsDocument - Auto Create Fulfillments On Completion

Name Value
Code R32687
Entity LogisticsDocument
Name AutoCreateFulfillmentsOnCompletion
Attribute -
Layer Back-End
Events Completed
Priority Normal
Modify YES
Applicable Legislations ALL // no condition needed
Action If LogiscticsDocument.DocumentType.CompleteParentFulfillments == true, then execute the following steps:

1. Get the first Logistics Document Line.
If LogisticsDocumentLine.ParentDocument == null OR LogisticsDocumentLine.ParentLineNo == null, then skip this line.
Else, continue with step 2.

2. Find all Document Fulfillments, where DocumentFulfillment.DocumentLineId = current.LogisticsDocumentLine.Id AND DocumentFulfillment.FulfillmentType = Completed

3. For each record found in step 3, create a corresponding Completed record for the parent document line, as follows:

DocumentFulfillment.Document = LogisticsDocumentLine.ParentDocument
DocumentFulfillment.DocumentLineId = FIRST(LogisticsDocument.ParentDocument.ChildLines, where LineNo = LogisticsDocument.ParentLineNo).Id
DocumentFulfillment.LineNo = LogisticsDocument.ParentLineNo
DocumentFulfillment.FulfillmentType = Completed
DocumentFulfillment.IsFinal = false
DocumentFulfillment.LineType = the LineType of the DocumentFulfillment found in step 2
DocumentFulfillment.QuantityBase = the QuantityBase of the DocumentFulfillment found in step 2
DocumentFulfillment.Product = the Product of the DocumentFulfillment found in step 2
DocumentFulfillment.StandardQuantity = the StandardQuantity of the DocumentFulfillment found in step 2
DocumentFulfillment.SerialNumber = the SerialNumber of the DocumentFulfillment found in step 2
DocumentFulfillment.Lot = the Lot of the DocumentFulfillment found in step 2
DocumentFulfillment.ProductVariant = the ProductVariant of the DocumentFulfillment found in step 2
DocumentFulfillment.CreationUser = the current user
DocumentFulfillment.DestinationEntityName = the entity name of the line of the current document

5. Repeat steps 1, 2, 3, and 4 for all other (if any) Lines of the current document.

Important: The rule does not apply to Warehouse Orders.
Description When document state is changed to Completed, creates Completed document fulfillments for the executed quantities of the parent document lines.
The rule is activated only for documents in whose document type the 'Complete Parent Fulfillments' field is checked. This check-mark and respectively the business rule, are usually used combination with a generation procedure which uses document fulfillments.
This rule does no apply to Warehouse Orders. In Warehouse Orders the creating of the parent fulfillments is done by rule R33563.
Message -
Introduced In Version Introduced: 2022
Updated: v.2023 Stops activating for Warehouse Orders (replaced by R33563).
Revocable NO