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
Mike MelnickMike Melnick 

How to determine the value of a field when the record is opened

We have a business case where we want to require validation when an opportunity is approved.  

Currently we have a custom status field that moves from Draft -> Submitted -> Approved.  We want to make sure another custom field is populated before the status changes from Submitted to Approved.

I thought I could use priorvalue to determine if the status was changed during an edit session, but it appears that priorvalue returns the last value of the field independent f when it was editted.  ie, if yesterday the value was changed from Draft to Submitted and today the record is edited again, the priorvalue still returns Draft even in today's edit session.

Any ideas?
Prateek Singh SengarPrateek Singh Sengar
Hi Mike,
You should trying using ISCHANGED along with PRIORVALUE, Your validation will look something like
AND(ISCHANGED(picklist_field), ISPICKVAL(PRIORVALUE (picklist_field), text_literal))
Hope this helps.