[SalesForce] Create a formula text field to display prior value or text field

I'm wondering if it is possible to create a formula field that will display the previous value of a text field.

Example:
If an account name is changed, display that previous value in the formula field. I tried: PRIORVALUE(Name) but received an error of "PRIORVALUE may not be used in this type of formula"

Best Answer

No, there is no formula for this; formula functions like ISCHANGED and PRIORVALUE only work in the context when a field value is transitioning from one value to another (i.e. during a DML update). Old values are not stored in the database (other than field history, which can't be used in a formula anyways).

The best you could do is create a text field called something like "Field Previous Value," then set a Process Builder/Workflow Rule that copies the prior value of the field to this second text field when the field changes. As a workflow example: "Evaluate when the following formula is true: ISCHANGED(FieldName)" with a workflow field update "Previous Field Value set to formula PRIORVALUE(FieldName).

Related Topic