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

(Henry Scott) #1

“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.

(Henry Scott) #2

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

(Henry Scott) #3

@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

(Henry Scott) #4

@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] )