2 of 2 people found this helpful
The OOTB offering called "Frequent Traveler Setup" has a working example. It's a bit drawn out because of how it's used.
So you have two objects FulfillmentItemPackage and FullfillmentItem. Package is just a template, when a package is used it creates a fulfillmentitem. So "Fulfillment items are built from fulfillment item packages".
In the packages, you have the Task Catalog tab. These are the tasks that would be created by the task/template block for that fullfillment item. So in that sense, "Tasks are built from Task Catalogs"
I am trying to clarify this as it will get confusing down the line since you dealing with so many items and the insert multi child block is important for the values it's entering into the fulfillment items.
1. With 'Frequent Traveler Setup', a list is used to select fulfillment items from a list of packages
2. The WF will then iterate over that list adding fulfillmentitem objects to the service request.
3. When the fulfillmentitem is added, the WF on that object will fire, which will fire the Task/template block.
4. That block will iterate over the list of tasks catalog items created on the fullfillmentitempackage to create tasks and attach them to fulfillmentitem (they won't be added directly to the SR).
The way the fulfillment works is actually 'dumb' in how the items are actually added. It just adds child items.
So you have a list of fulfillment items, this is just a list item that is validated against fulfillment. This is what the Multi block iterates over when inserting items.
On the Insert Multi-Child
1. You first have to define the relationship as you are just adding new entries
2. You also define which field or parameter to iterate over. In this case it's the list control called 'Items'
3. The expressions then pull the data from each selected 'item' and create FullfillmentItems. They are used this way since its pulling in data from the picklist. 'boRecId' is the RecID of the entry the multi child block is working with at that time.
$(GetBOValue(RecId, "boRecId", "FulfillmentItemPackage#", "Name"))
This is why you select the 'Select Child Object Type' relationship above, it's whats tied to FulfillmentItem.
Just adds to this tab:
So all the first "insert multi child" workflow does is add the fulfillment items. There is actually a standard workflow in FulfillmentItem that is responsible for adding the tasks from the catalog.
In the object 'FulfillmentItem' there is a workflow that fires whenever a new fulfillment item is created. This is the WF that uses Task/Template Instantiation. So when the first WF create the fulfillment item, this is what fires to create the tasks on the fulfillmentitem, based on the template.
On the initial insert multi-child block, you define which relationships should be used for the template. Note how the TemplateLink_Relationship is between FulfillmentItemPackage and TaskCatalog as it's creating tasks based on the catalog items linked to the package.
That's important as that's is used in the Task/Template block. It tells the block how it relates to the Task Catalog.
On the fulfillment item...
TemplateLink_Category: FulfillmentItemPackage This is the name of the base business object that is being evaluated
TemplateLink: $(GetBOValue(RecId, "boRecId", "FulfillmentItemPackage#", "RecId")) This is pulling down the recid of the fullfillment package that is currently being processed through that iteration of insert-multi child.
TemplateLink_Relationship: FulfillmentItemPackageAssocTaskCatalog This is the relationship to TaskCatalog from FullmentitemPackage. The block iterates over all items found in this relationship (specific to the package recid) and inserts the tasks using the 'Target'. This is what causes multiple tasks to be added.
Target is where the task will be created.
Here is a Fulfillment Item Package with two task catalog items, so each time this is used, two tasks should be created.
Here is the submission.
Here is the outcome:
The two expected task were created.
I tried the steps which you provided and it worked.
Thank you very much for this.