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. 

...

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. 

...

Process Builder will not change the field names if you change them. It doesn't stop you from changing the API Name of the field, like it does in other cases. It will then make the PB fail and you will NOT be able to clone the Process to fix it - you will have to change the API names back to what they were - you did remember didn't you? Then deactivate the Processes, then change the API names, then change them in the Process, the activate and test the process. Oh this is a fabulously detailed post from Johan (@simplysfdc) on this topic http://www.simplysfdc.com/2016/09/salesforce-rename-field-name_4.html

Using __c instead of __r

Why oh why oh why does the field picker enter the relationships with a __c rather than a __r. Since day dot we are told that ALL relationships notation is replace the __c with a __r. Why isn't it the same here? It is just bizarre. 

Why aren't scheduled actions visible? 

...