function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tuur Dutoit 13Tuur Dutoit 13 

PRIORVALUE in Process Builder doesn't work

I'm trying to make a process in Process Builder that updates an record's owner when a picklist on that record changes from one specific value to another specific value. So I created a criteria, with the "Formula evaluates to true" option and this formula:
AND(
 ISPICKVAL([creddox__project_credential__c].creddox__Project_Record_Approval_Status__c, "Draft - Not Submitted"),
 ISPICKVAL(PRIORVALUE([creddox__project_credential__c].creddox__Project_Record_Approval_Status__c), "Requested - In Review")
)
(Followed by a field update action, of course, but that's not relevant here)
This tests whether the value is equal to "Draft - Not Submitted" and was "Requested - In Review"; in other words, it changed from the latter to the former.
Note that the "Do you want to execute the actions only when specified changes are made to the record?" checkbox is not checked, I inserted the fields in the formula using the field chooser dialog and copied the values from the setup page of the object in question. I checked a dozen times if the records were correctly updated from the first value to the second one. I also tested whether the process is triggered at all (with a second criteria that always executes), and it does. This also proves it's the criteria evaluating to false, and not the field update failing. So the formula should be correct, the tests I do are correct, and I know for a fact the process runs. This means the formula evaluates to false for some reason.

The weird thing is, this problem occurs when triggered by a field update (of the picklist), which was triggered as a final approval action of an approval process. So I tried what would happened if I changed the picklist manually, and lo and behold, the process works fine then.

Could this be bug in Salesforce, or am I missing something?
ujwal thejaujwal theja
Hi,

I got your point. Please try below formula once. I think it will work for you.
If Not, please confirm me. I will try once again.
 
IF(AND(
 ISPICKVAL([creddox__project_credential__c].creddox__Project_Record_Approval_Status__c, "Draft - Not Submitted"),
 ISPICKVAL(PRIORVALUE([creddox__project_credential__c].creddox__Project_Record_Approval_Status__c), "Requested - In Review")
), true, false)

Thanks,
Ujwal K