Trapped in Process fails with error 'The flow failed to access the value because it hasn't been set or assigned' WHILE IT IS NOT
If you have no idea about Known Issue : Process fails with error 'The flow failed to access the value because it hasn't been set or assigned' , it's worth to check it first then you might want to read this entry.Issue : The user reports that when using Mass Edit to edit Opportunity it will prompt error
Can't Save Record
That's it. No sweet lovely sentence, no flowery and it's leave the mystery for us to dig out the root cause.Typical communication breakdown in love story.
Luckily we have email system whereby we got chance to get the exception email straight in our inbox.Here the error :
Error element myDecision (FlowDecision).
The flow failed to access the value for myVariable_current.Owner.UserRole.DeveloperName because it hasn't been set or assigned.
Just to clarify , yes we use process builder and we are aware of issue above whereby we need to put condition checking in proper order whenever our condition need to check value from other object.This is known issue described here.
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.
Our process builder complied with the rules still it happening?
To test , I modified from condition based to formula well something like this.
AND(NOT(ISBLANK([Opportunity].Owner.UserRoleId )) , OR ( [Opportunity].Owner.UserRole.DeveloperName ='Sales Manager' , [Opportunity].Owner.UserRole.DeveloperName ='APAC Manager'') )
and pray to God.
Unfortunately it's still happening and I am not able to get much information when Googling.
How the user input?
Using Mass Edit.
Is Process Builder does not support bulk?
Nope- process builder support bulkified .This is delivered in Winter 16. Plus the exception that we face nothing to do with limit.
What is MassEdit?
It is visualforce page that we installed long time ago.
Is it using customize controller?
No, it using standard controller.The save still same like standard, the only thing that different is the UI.No fancy code.
Click on Version Settings of visualforce page.
15...Change to 42 and pray to God.
Success. No Error.
Yes, upgrade version can solve problem.It will be easier if the error message tell me something wrong with version.
Typical communication-breakdown =)