[SalesForce] Flow Error Occured “The flow failed to access the value for”
I am getting this flow error,while updating field in process builder:
This error occurred when the flow tried to update records: The flow failed to access the value for myVariable_current.RecordType.Name because it hasn't been set or assigned..
Best Answer
I'm assuming the right-hand-side of this image would show that you're assigning the reference to the Record Type Name of that SymphonyIPM__ record. This issue will occur when that object's Record Type is null, because in trying to reach the record type's name you're actually traversing a join:
(my object)->RecordType via RecordTypeId->Name
When RecordTypeId is null, this results in an exception.
This isn't actually the right way to assign an object's record type in Process Builder, however. Instead of assigning the Record Type Name, simply assign the RecordTypeId directly. That will work even if your source record has a null record type.
I think it's because it's a new order. There is no old value to compare against. Change the process builder criteria to a formula which makes sure it doesn't fire if it is new.
Ischanged( [Order].OwnerId) && ! Isnew()
As an important side note, I often need to use formulas in process builder criteria for Ischanged and Isnew as Salesforce doesn't consider a new record to be a chanted record.
I ran into this problem in our org. Move the lines of criteria about the "Account ID is null - false" & "Contact ID is null - false" to the first two lines of criteria. I'm not sure the reasoning behind this. We contacted support and had a similar error and couldn't figure it out. When we put the boolean criteria in the first two lines as they suggest, the Process Builder worked with no errors.
Best Answer
I'm assuming the right-hand-side of this image would show that you're assigning the reference to the Record Type Name of that
SymphonyIPM__
record. This issue will occur when that object's Record Type is null, because in trying to reach the record type's name you're actually traversing a join:When
RecordTypeId
isnull
, this results in an exception.This isn't actually the right way to assign an object's record type in Process Builder, however. Instead of assigning the Record Type Name, simply assign the
RecordTypeId
directly. That will work even if your source record has a null record type.