You need to sign in to do that
Don't have an account?
Giselle Arrioja
Insert or update in Validation Rule
Is there any way to know within a validation rule if the record is being evaluated is inserted (first time ) or updated ?
Example: I have this formula in a Validation Rule:
Total_Montos_Financiamiento__c - PRIORVALUE(Monto__c) + Monto__c > Proyecto__r.Importe_Regla_Validacion__c
But when the record is being inserted for fist time, the system dont have PRIORVALUE, but the same amount I 'm trying to save and I want that the PRIORVALUE will be 0 (not the Amount) .
Any help? please!
Example: I have this formula in a Validation Rule:
Total_Montos_Financiamiento__c - PRIORVALUE(Monto__c) + Monto__c > Proyecto__r.Importe_Regla_Validacion__c
But when the record is being inserted for fist time, the system dont have PRIORVALUE, but the same amount I 'm trying to save and I want that the PRIORVALUE will be 0 (not the Amount) .
Any help? please!
In addition to Parker, providing more information for you.
ISNEW --- Checks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing record is being updated, this function returns FALSE.
Tips:
This function is available only in validation rules, field updates, workflow rules, assignment rules, and Process Builder formula criteria.
Use the NOT function to reverse the return values of TRUE and FALSE.
This function always returns FALSE when used in a workflow rule with a time-based trigger.
This function always returns FALSE when used in a field update for an approval action.
Please check the below link:
https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISNEW
Please do let me know if helps you.
Regards,
Mahesh
Try to check the below validation rule
AND(ISNEW(),(Total_Montos_Financiamiento__c - PRIORVALUE(Monto__c) + Monto__c) > Proyecto__r.Importe_Regla_Validacion__c)
Best Regards,
Deepthi
Total_Montos_Financiamiento__c - IF( ISNEW(), 0, PRIORVALUE(Monto__c)) + Monto__c > Proyecto__r.Importe_Regla_Validacion__c
If any one of us has answered your question, please let us know.
Thanks,
Parker