"Sending Email After Adding a Parent Record a...

โ€œSending Email After Adding a Parent Record and All of Its Childrenโ€

I executed the instructions below from the Help with a Customer, To Equipment To EquipmentComponent (Parent-Child-ChildOfChild) relationship. See my โ€œSpecโ€ screen capture

I can see that the Status is set, but I cannot see the Workflow firing in my Audit History and thus do not

get the Email that the Customer was added See attached screen capture of the Audit History where the Status is set but no Workflow fired

Question: Does this technique below only work with a Parent-Child relationship? Seems I cannot get it working with a Parent-Child-ChildOfChild

โ€œSending Email After Adding a Parent Record and All of Its Childrenโ€ Currently, when you add a parent record along with one or more children records, we first add the parent record, and we then add each of the child records. This can make it difficult to trigger a workflow only after all of the child records have been added.

You can can use the following technique to ensure that all parent and child records are added before the workflow runs. This technique uses the Form Saved event to trigger a Data Change action. The Data Change action sets the value of a Status column to a specific value. The workflow ruleโ€™s Condition, triggers the workflow rule when the Status column contains that specific value.

Do this as follows: Add a Status column to the parent record. This Status column indicates whether the workflow rule should fire. The Status column can be a simple text column. Assign this column an InitialValue that indicates that the workflow rule should not fire. For example, you might set the Status columnโ€™s value to blank. Create a Data Change action to update the Status columnโ€™s value. Set the columnโ€™s value to the value that triggers the workflow rule. For example, you might set the Status columnโ€™s value to โ€œRunโ€. Go to the parent form. Set its โ€œform savedโ€ event to invoke the Data Change action. Configure your workflow rule. Set the workflow ruleโ€™s โ€œUpdate eventโ€ to fire on updates. Set the workflow ruleโ€™s Condition to check the value of the Status column. For example, you might specify the Condition:

[Status] = โ€œRunโ€ To make the workflow only fire once, you can replace the single Data Change action with a Composite Action. The Composite Action would invoke the first Data Change action to set the Status columnโ€™s value to โ€œRunโ€, and the second Data Change action to clear the Status columnโ€™s value to blank. These two Data Changes will come in as separate updates. The first update fires the workflow rule, while the second update prevents further updates from firing the workflow rule.

0 3 574
3 REPLIES 3

@Philip_Garrett_Appsh can you have a look at this one for me please.

@Philip_Garrett_Appsh I have a Composite Action that sets the field I use as a check for the Workflow to fire and then I clear that field again

@Philip_Garrett_Appsh I read another post where you mentioned to someone that the condition check is incorrect You referenced the Help Article code below. Just want to know in my scenario (Children to be added to Parent before Workfloe Email is fired) should also do the check as per the sample code below?

AND( [MyCheckField]=โ€œEquipmentAddedโ€, [_THISROW_BEFORE].[MyCheckField] <> [_THISROW_AFTER].[MyCheckField] )

Top Labels in this Space