function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BobBob 

The flow failed to access the value for myVariable_old.AccountId because it hasn't been set or assigned.

I am having an issue with one a flow process. It keeps giving me  the following error. The flow failed to access the value for myVariable_old.AccountId because it hasn't been set or assigned.
User-added image

User-added image
NagendraNagendra (Salesforce Developers) 
Hi Bob,

Description:A Process that makes a cross-object reference will fail when the foreign key (i.e. relationship field) the reference depends on is not populated.

For example, if a Process on Contact has the criteria "[Contact].Account.Name equals Acme", this Process will fail when triggered on a Contact where Account is blank. The generated error in Debug Logs would be like "The flow failed to access the value for myVariable_current.Account.Name because it hasn't been set or assigned. "

Resolution: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.

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 that 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")

Kindly mark this post as solved if the information help's so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P
BobBob
This is the error
An error occurred at element isChangedDecision12_myRule_3_AccountId (FlowDecision).
The flow failed to access the value for myVariable_old.AccountId because it hasn't been set or assigned.


This is the report I recieved in my email

Flow Details
Flow Name: Set_Primary_Quote_Process
Type: Workflow
Version: 4
Status: Active
Flow Interview Details
Interview Label: Set_Primary_Quote_Process-4_Quote
Current User: NA Integration User (00580000003Mg0C)
Start time: 10/13/2016 8:20 PM
Duration: 0 seconds
How the Interview Started
NA Integration User (00580000003Mg0C) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 0Q034000000APRsCAO
myVariable_current = 0Q034000000APRsCAO
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "10/13/2016 8:20 PM"
DECISION: isChangedDecision4_myRule_3_OpportunityId
DECISION: isChangedDecision5_myRule_3_Name
DECISION: isChangedDecision6_myRule_3_Oracle_Quote_c
DECISION: isChangedDecision7_myRule_3_Amount_c
Executed this outcome: isChangedRule_7_myRule_3_Amount_c
Outcome conditions: and
1. {!myVariable_old} (0Q034000000APRsCAO) Is null false
2. {!myVariable_old.Amount__c} (54,280) Does not equal {!myVariable_current.Amount__c} (53,390)
Logic: All conditions must be true (AND)
DECISION: isChangedDecision8_myRule_3_Net_Revenue_c
Executed this outcome: isChangedRule_8_myRule_3_Net_Revenue_c
Outcome conditions: and
1. {!myVariable_old} (0Q034000000APRsCAO) Is null false
2. {!myVariable_old.Net_Revenue__c} (39,966.7) Does not equal {!myVariable_current.Net_Revenue__c} (30,502.1)
Logic: All conditions must be true (AND)
DECISION: isChangedDecision9_myRule_3_Order_Type_c
DECISION: isChangedDecision10_myRule_3_Pricebook_c
DECISION: isChangedDecision11_myRule_3_Discount_c
Executed this outcome: isChangedRule_11_myRule_3_Discount_c
Outcome conditions: and
1. {!myVariable_old} (0Q034000000APRsCAO) Is null false
2. {!myVariable_old.Discount__c} (26.37) Does not equal {!myVariable_current.Discount__c} (42.87)
Logic: All conditions must be true (AND)
Michael Bobee 4Michael Bobee 4
Hold on,- I had a populated relationship between a Work Order, Account, and it's Address, but the I received the same error from a Process Builder process to try and transfer the address to the work order,- this came up. Is this the "key to the door" before you proceed? I don't have the above suggestion on my PB process and it seems to work,- albeit intermittent ...