You need to sign in to do that
Don't have an account?

An unhandled fault has occurred in this flow
I'm attempting to use a loop element in a flow I have created. My goal is to populate a custom lookup field on the Account record that looksup to the contact on the last closed opportunity. I'm not sure where my flow is going wrong, but when I select run, I get a message that there is an unhandled fault.
I have included an image of my flow below:

Thanks for the help!
I have included an image of my flow below:
Thanks for the help!
You can export the definition of your flow easily with a workbench so other people can analyze and even import it completely effortless.
1) Create this text file: packflow.xml with the content below (ie: c:\temp\packflow.xml) (very easy)
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>Flow</name>
</types>
<version>41.0</version>
</Package>
2) Connect to the workbench (production or sandbox) with the credentials of your used org (if needed) (very easy)
https://workbench.developerforce.com/login.php
3) Menu: migration > retrieve
4) Select the created file for the Unpackaged Manifest : packflow.xml and button: Next
5) Button: Retrieve
6) Link: Download ZIP File
7) Open the downloaded ZIP File and extract all the files.
8) Copy/paste here the content of the file: <your flow name>-<version>.flow
I will know everything (100%) of your flow definition. I can read all the details of your flow directly from the metadata definition.
An example of Declarative Metadata Definition is shown here at the bottom of the page:
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_visual_workflow.htm
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<assignments>
<name>Add_to_Update_Collection</name>
<label>Add to Update Collection</label>
<locationX>675</locationX>
<locationY>497</locationY>
<assignmentItems>
<assignToReference>UpdateAccounts</assignToReference>
<operator>Add</operator>
<value>
<elementReference>so_Account</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Loop_Accounts_with_Closed_Opps</targetReference>
</connector>
</assignments>
<assignments>
<name>Update_Contact</name>
<label>Update_Contact</label>
<locationX>680</locationX>
<locationY>316</locationY>
<assignmentItems>
<assignToReference>so_Account.Primary_Contact__c</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>v_ContactId</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Add_to_Update_Collection</targetReference>
</connector>
</assignments>
<interviewLabel>Mass Update {!$Flow.CurrentDateTime}</interviewLabel>
<label>Mass Update Accounts with Closed Opps_V2</label>
<loops>
<name>Loop_Accounts_with_Closed_Opps</name>
<label>Loop Accounts with Closed Opps</label>
<locationX>56</locationX>
<locationY>280</locationY>
<assignNextValueToReference>so_Account</assignNextValueToReference>
<collectionReference>soColl_Accounts</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Last_Closed_Opp</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>Accounts</targetReference>
</noMoreValuesConnector>
</loops>
<processType>AutoLaunchedFlow</processType>
<recordLookups>
<name>Last_Closed_Opp</name>
<label>Last Closed Opp</label>
<locationX>282</locationX>
<locationY>120</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Look_Up_Contact_Role</targetReference>
</connector>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>so_Account.Id</elementReference>
</value>
</filters>
<filters>
<field>CloseDate</field>
<operator>EqualTo</operator>
<value>
<elementReference>so_Account.Most_Recent_Opportunit__c</elementReference>
</value>
</filters>
<object>Opportunity</object>
<outputAssignments>
<assignToReference>v_OpportunityID</assignToReference>
<field>Id</field>
</outputAssignments>
</recordLookups>
<recordLookups>
<name>Look_up_Account_with_Closed_Opp</name>
<label>Look up Account with Closed Opp</label>
<locationX>53</locationX>
<locationY>154</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Loop_Accounts_with_Closed_Opps</targetReference>
</connector>
<filters>
<field>Opportunity_Amount_Total__c</field>
<operator>GreaterThan</operator>
<value>
<numberValue>0.0</numberValue>
</value>
</filters>
<object>Account</object>
<outputReference>soColl_Accounts</outputReference>
<queriedFields>Id</queriedFields>
<queriedFields>Most_Recent_Opportunit__c</queriedFields>
<queriedFields>Primary_Contact__c</queriedFields>
</recordLookups>
<recordLookups>
<name>Look_Up_Contact_Role</name>
<label>Look Up Contact Role</label>
<locationX>497</locationX>
<locationY>126</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Lookup_Contact</targetReference>
</connector>
<filters>
<field>OpportunityId</field>
<operator>EqualTo</operator>
<value>
<elementReference>v_OpportunityID</elementReference>
</value>
</filters>
<object>OpportunityContactRole</object>
<outputAssignments>
<assignToReference>v_ContactId</assignToReference>
<field>ContactId</field>
</outputAssignments>
</recordLookups>
<recordLookups>
<name>Lookup_Contact</name>
<label>Lookup Contact</label>
<locationX>669</locationX>
<locationY>123</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Update_Contact</targetReference>
</connector>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>v_ContactId</elementReference>
</value>
</filters>
<object>Contact</object>
<outputAssignments>
<assignToReference>v_Inactive</assignToReference>
<field>Inactive__c</field>
</outputAssignments>
</recordLookups>
<recordUpdates>
<name>Accounts</name>
<label>Accounts</label>
<locationX>54</locationX>
<locationY>413</locationY>
<inputReference>UpdateAccounts</inputReference>
</recordUpdates>
<startElementReference>Look_up_Account_with_Closed_Opp</startElementReference>
<variables>
<name>so_Account</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>soColl_Accounts</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>UpdateAccounts</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>v_ContactId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
</variables>
<variables>
<name>v_Inactive</name>
<dataType>Boolean</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
</variables>
<variables>
<name>v_OpportunityID</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>true</isOutput>
</variables>
</Flow>
I can do the exact opposite operation called "deploy" with the workbench now.
And I have exactly your flow in my free developer org so I can test it directly if necessary.
I will let you know as soon as everything is clarified.
You can also see the log of your workflow launching it with Developer Console open.
You have used a very large scope for the main Fast Lookup : all the accounts with Opportunity_Amount_Total__c > 0
You can do that in "theory" but that could exceed the governor limits.
What is the content of your log?
Thanks for testing. Where can I find the content of my log?
Best,
Brianna
a) To open the Developer Console from Salesforce Classic:
- https://help.salesforce.com/articleView?id=code_dev_console_opening.htm&type=5
b) Run your flowc) Select the tab: Logs (like above) and double-click where your see /flow/... in the Developer Console
I will continue to look at your imported flow but it could already be fine.