Comparison of formula number type field between PRIORVALUE (or other comparisons such as ISCHANGED) and current value does not work as expected
Last updated 2022-02-10 ·Reference W-2910523 ·Reported By 26 users
Summary
SUMMARY:
Comparison of formula number type field between PRIORVALUE and current value does not work as expected if the value is a floating point number.
Note: This also affects other formula comparisons such as ISCHANGED, causing formulas to evaluate to true even when no edit is taking place on the floating point field. For example, the formula ISCHANGED(Amount) on Opportunities may evaluate to true even when only editing other fields.
- Actual Result:
Even if prior value is the same with current value, "PRIORVALUE(formulafield) = formulafield" returns false.
- Expected Result:
If prior value is the same with current value, "PRIORVALUE(formulafield) = formulafield" should return true.
Repro
- Steps to reproduce
1. create a Custom Object
Name : TEST
2. add Custom Fields to the above Custom Object
2-1. Number Field
Name : NumberField
API Name : NumberField__c
Data Type : Number
Length : 18
Decimal Places : 0
2-2. Formula Field
Name : FormulaField
API Name : FormulaField__c
Data Type : Formula
Formula Return Type : Number
Decimal Places : 1
Formula Body : NumberField__c / 10
2-3. Text Field
Name : TextField
API Name : TextField__c
Data Type : Text
Length : 10
3. create a Custom Object Tab for the above Custom Object
4. create a record for the Custom Object
Name : Test2
NumberField : 101
5. create a Process as follows
5-1. Process Definition
Name : TEST1
Object : TEST
Start the process : chose "when a record is created or edited"
5-2. Criteria for Action Group
Criteria Name : Check Formula Field
Criteria for Executing Actions : chose "Formula evaluates to true"
Build Formula : PRIORVALUE([TEST__c].FormulaField__c) = [TEST__c].FormulaField__c
5-2. Immediate Action
Action Type : Update Records
Action Name : Update Text Field
Record Type : chose "Select the TEST__c record that started your process"
Criteria for Updating Records : chose "No criteria—just update the records!"
Set new field values for the records you update:
Field : TextField
Type : String
Value : UPDATE!!!
6. activate the above process
7. edit the above record which was created in Step 4 and save with no change
You will see TextField is not updated. This is unexpected.
8. If NumberField of the record is 100, the process will work as expected.
Workaround
When using PRIORVALUE: You can't use Comparison of formula number type field between PRIORVALUE and current value - don't use floating point number in Formula field.
When using ISCHANGED: Example formula: OR( ISCHANGED ( Amount ), ISCHANGED ( CloseDate) )
You can consider using criteria instead:
Amount IsChanged equals true
CloseDate IsChanged equals True
With filter logic (1 OR 2 )
Reported By (26)





Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.