+ Start a Discussion
Nishant Prajapati 10Nishant Prajapati 10 

Process Automation Superbatch step 5

Error:-
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3017F000000gR4k. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []
And in developer console it shows-FLOW_ELEMENT_ERROR The flow failed to access the value for myVariable_current.Account.Type because it hasn't been set or assigned.
Best Answer chosen by Nishant Prajapati 10
David HalesDavid Hales
Hi Nishant,

To avoid this type of error, use criteria to check if the foreign key (aka relationship) field is null before making cross-object references based on that field.

Note: The order of the criteria matters. The check to verify that a lookup is not null must be made before evaluating any conditions which make a cross-object reference across that lookup.

Continuing the example given above, the process criteria should be "[Contact].AccountId Is Null False" AND "[Contact].Account.Name equals Acme" (in that order - the check for AccountId being null has to be before the cross-object reference which relies on the Account field being populated).

When using "Formula evaluates to true" in the Criteria for Executing Actions*, the formula below can be used in this example:
 
AND (NOT(ISBLANK( [Contact].AccountId )), [Contact].Account.Name = "Acme")

If the above suggestion worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future. 

Thanks & Regards 
David Hales(1053)
Kloudrac Software Pvt. Ltd.


 

All Answers

David HalesDavid Hales
Hi Nishant,

To avoid this type of error, use criteria to check if the foreign key (aka relationship) field is null before making cross-object references based on that field.

Note: The order of the criteria matters. The check to verify that a lookup is not null must be made before evaluating any conditions which make a cross-object reference across that lookup.

Continuing the example given above, the process criteria should be "[Contact].AccountId Is Null False" AND "[Contact].Account.Name equals Acme" (in that order - the check for AccountId being null has to be before the cross-object reference which relies on the Account field being populated).

When using "Formula evaluates to true" in the Criteria for Executing Actions*, the formula below can be used in this example:
 
AND (NOT(ISBLANK( [Contact].AccountId )), [Contact].Account.Name = "Acme")

If the above suggestion worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future. 

Thanks & Regards 
David Hales(1053)
Kloudrac Software Pvt. Ltd.


 
This was selected as the best answer
Marina Shuman 1Marina Shuman 1
David is right that the "unhandled error" message means that the process is referencing a null value in a lookup field. In this superbadge specifically, when I ran into this issue it was because I didn't have any user set as my manager. Since the approval process notifies the manager of the opportunity owner, the opportunity owner (you) must have a manager. Double check in your user profile whether you have set the "Nushi Davoud" user you created as part of the trailhead instructions as your manager. 
Nishant Prajapati 10Nishant Prajapati 10
Thanks David & Marina,
Marina,  I also ran into the same, Manager was not set.