Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Oh those dreaded process builder errors. They are sooooo annoying. You spend so much time and effort building a great solution for your users and all that good work is undone with a badly worded error message. What can the user even do about this - there is nothing they can do except undo what they were trying to do and get frustrated and annoyed. 

...

So of course, the first thing you do is copy and paste the error message into Google hoping to quickly find the solution. Ah you are out of luck there. 

The first post you come across is a Salesforce KB article - great, that will answer it all

https://help.salesforce.com/apex/HTViewSolution?id=000212174&language=en_US

It says "use criteria to check if the foreign key (aka relationship) field is null before making cross-object references based on that field". Let's try that. 

Image Modified

I changed the critera to this - Ooh it works - Wow! Who knew. (Note: In all the times previously I have tried to do anything like this it has never ever worked). I tried it with another criteria (CampignID is changed = true) and tried it with the is null criteria second - no errors. Weird. I have always had errors in the past. 

So I changed it to a formula (NOT(ISBLANK([Opportunity].CampaignID)) and even that worked. Previously, I was told to always use formulas rather than criteria, and even that didn't work - is it just luck that this is working now whilst I am trying to write these notes up? 

OK, here we go. I changed the formula to NOT(ISNULL([Opportunity].CampaignID)) and the error appeared. See below re ISBLANK AND ISNULL. Why does this occur? Why? The two formulas SHOULD evaluate exactly the same. Especially on a string ID field. 

So I changed the criteria to 

Yet another way to do it - and it worked - why, why oh why does this work. Why does this work and ISNULL does not work - they SHOULD BE THE SAME THING! 

...

So I changed the criteria back to ISNULL and yep, it failed again - I just had to check because EVERYTHING ELSE WORKS! 

This article says be careful of the order of your criteria http://salesforce.stackexchange.com/questions/92472/lightning-process-builder-exception and then you get devs who don't understand the difference between Process Builder and Flow (because the error messages are SO helpful (not)) and they answer questions like this http://salesforce.stackexchange.com/questions/93471/process-builder-giving-error-the-flow-failed-to-access-the-value-for-example-b - not helpful. 

Here's an article that seems to suggest doing multiple different things, all that either work or don't work in certain circumstances https://success.salesforce.com/answers?id=9063000000046YoAAI How confusing! 

Fixing this Error

Thanks to the lovely Beth (@bethbrains), she gave me what seems to be the definitive answer on how to fix this. 

...