6

Note: This error might look like a familiar error but the resolution mentioned in the salesforce knowledge article is not working in the below case and I am not sure why, hence posting this question.

Problem description:

  1. I have a process builder on case object set to fire for every time new record is created.
  2. Criteria is set to 'Formula evaluates to True' with below formula: AND(NOT(ISBLANK([Case].AccountId)),ISPICKVAL([Case].Account.Active__c,'Yes'))
  3. With immediate action set to update custom field on the Case object.
  4. Custom field Active__c on the Account object is type picklist with two possible values 'yes' and 'no'.

Screenshots of the process builder:

enter image description here

enter image description here

enter image description here

Creating a case as shown in the below screenshot with very minimal details and especially not populating account details:

enter image description here

Throws below error:

The flow failed to access the value for myVariable_current.Account.Active__c because it hasn't been set or assigned.

Relevant data from log file:

22:14:31.0 (12479016)|WF_FLOW_ACTION_BEGIN|09L370000000FEJ 22:14:31.13 (13607478)|FLOW_CREATE_INTERVIEW_BEGIN|00D37000000H8hr|300370000008ZTl|301370000004weE 22:14:31.13 (15394571)|FLOW_CREATE_INTERVIEW_END|5525dfa7819c33f438ce3cef9b6c15c668d8ff2-3d11|Test 22:14:31.15 (15820974)|FLOW_START_INTERVIEWS_BEGIN|1 22:14:31.15 (16674702)|FLOW_START_INTERVIEW_BEGIN|5525dfa7819c33f438ce3cef9b6c15c668d8ff2-3d11|Test 22:14:31.15 (35470120)|FLOW_ELEMENT_ERROR|The flow failed to access the value for myVariable_current.Account.Active__c because it hasn't been set or assigned.|| 22:14:31.15 (35479812)|FLOW_START_INTERVIEW_END|5525dfa7819c33f438ce3cef9b6c15c668d8ff2-3d11|Test 22:14:31.15 (35517783)|FLOW_START_INTERVIEWS_END|Interview error. Aborting all.|5525dfa7819c33f438ce3cef9b6c15c668d8ff2-3d11|Test 22:14:31.15 (35528335)|FLOW_START_INTERVIEWS_END|1 22:14:31.0 (35588898)|WF_FLOW_ACTION_ERROR|09L370000000FEJ|300370000008ZTl|Error executing flow: test, FlowDefId: 300370000008ZTl, FlowVersionId: 301370000004weE 22:14:31.0 (35612585)|WF_FLOW_ACTION_ERROR_DETAIL|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. 22:14:31.0 (35683203)|WF_FLOW_ACTION_END|09L370000000FEJ

URL to the complete debug log : https://pastebin.com/J5b7nX7g (Note: You can see from the log that there are no other workflow rules or triggers on the case object).

My analysis: When the first condition inside the AND expression is evaluating as false, why is it trying to evaluating the second condition to check the custom field on the Account object? It shouldn't right?

Any help?

EDIT: I am looking to solve this using option 'Formula Evaluates to True' only because I have other complex criteria like checking the day(Mon vs Tue and etc) of the case creation.

4
  • 1
    Formulas aren't particularly well optimized (e.g. short-circuit logic doesn't exist, as far as I can tell). Consider using normal criteria.
    – sfdcfox
    Jun 2, 2017 at 3:14
  • @sfdcfox But I am simply extending the resolution mentioned in the salesforce knowledge article and it does not work. Also, I cannot switch to conditions are met option because I have other criteria like the createddate = monday and other stuff which is possible only using formula criteria.
    – javanoob
    Jun 2, 2017 at 3:17
  • 2
    I realize that, and it seems trivial, but the PB is still a young technology and has a lot of hiccups in it. It shouldn't be failing without checking null; normal formula fields don't behave this way, so it's counter-intuitive. What we're basically left with is workarounds until someone fixes it.
    – sfdcfox
    Jun 2, 2017 at 3:23
  • @javanoob, find my updated answer Jun 2, 2017 at 4:39

5 Answers 5

4

Ok. I raised ticket with Salesforce on this and they came back saying it is a known issue(After more than a month of back and forth) and updated the Knowledge article with the work around for situations like these where Picklist fields are referenced in the formula.

NOTE: As mentioned in Known Issue W-2763830, this formula syntax does not work when using Formula-Based Criteria and making a cross-object reference to a Picklist field (specifically when using the TEXT or ISPICKVAL functions with the spanning reference to that picklist). If you need to make cross-object reference to a picklist field in Process Builder Criteria, use Condition-Based criteria. If you must use formula-based criteria, use the CASE function when making cross-object references to picklists.

URL to the known issue on this : https://success.salesforce.com/issues_view?id=a1p300000008aUBAAY

URL to the knowledge article: https://help.salesforce.com/articleView?id=000212174&type=1

In my case, I had to change the formula as below using CASE function instead of ISPICKVAL function:

Fails:

AND(NOT(ISBLANK([Case].AccountId)),ISPICKVAL([Case].Account.Active__c,'Yes'))

Works:

AND(NOT(ISBLANK([Case].AccountId)),CASE([Case].Account.Active__c,"Yes",1,0)=1)
2

Rather than using formula, Choose Conditions are met and use same conditions which you are mentioning in the formula, it will work smoothly.

update Case

If you do not mention the AccountId is not null then it will throw following error message.

error msg

Workaround using formulas

Breakdown the formula in 2 parts

  1. Account is Null, here just update a dummy action, as without specifying action you cannot activate the process.

Account is null

  1. Account is Active, here you can accommodate other conditions in the formula and run your desired update.

Account is active

6
  • Yes, but the first condition isn't strictly required, I think.
    – sfdcfox
    Jun 2, 2017 at 3:13
  • But I want to use formula evaluates to true option as I have other conditions like checking the mod values and other stuff. I am surprised as why the formula option does not work.
    – javanoob
    Jun 2, 2017 at 3:14
  • @SantanuBoral Saw the edit. Good to know.
    – sfdcfox
    Jun 2, 2017 at 3:19
  • I wish we could just end the process without defining dummy action when condition is TRUE. Thanks for your time in looking into this. Thanks again!
    – javanoob
    Jun 2, 2017 at 4:41
  • That I could wish too, but Salesforce doesn't allow that Jun 2, 2017 at 4:42
0

Can you try using below formula instead and try, Similar case worked for me.

AND([Case].AccountId!=Null, TEXT([Case].AccountActive)="Yes")
2
  • is that working for you? I dont think TEXT([Case].AccountActive) will compile even Jun 2, 2017 at 3:36
  • 1
    I just tried this and it throws same error.
    – javanoob
    Jun 2, 2017 at 3:58
0

Ok, As per Help doc, 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. So here in this error myVariable_current.Account.Active__c, it seems may be because we are not specifying the Active__c. So Can you try the below formula and check if it will work,

AND(NOT(ISBLANK([Case].AccountId)),([Case].Account.Active__c)!=Null, ISPICKVAL([Case].Account.Active__c),"Yes")
1
  • The formula you are suggesting has syntax error. I corrected that and tried but still fails with the same error.
    – javanoob
    Jun 2, 2017 at 13:38
0

I wished to provide my findings to this issue, as I found an even more complicated scenario which throws this error.

If you use a formula field as apart of a process builders criteria, and within this formula field you have cross object references. Well then the process builder will throw this error unless you first 'null check' the cross object reference even within the formula field.

Once null checked this error went away.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .