You need to sign in to do that
Don't have an account?
Validation rule ISNEW() && ISCHANGED
Hello,
I need assistance with a validation please.
The validation rule must fire, only when (1) criteria are met on a newly created records, or when any one of (2) two fields are changed, but not when the (2) two fields are both zero. It works fine on edited records, but not for new records. On new records the validation rule fires irrespective of whether the criteria are met
(1) AND(AND(RecordType.Name <> 'abc',
RecordType.Name <> 'def',
RecordType.Name <> 'gh',
RecordType.Name <> 'ijk',
RecordType.Name <> 'lmn') ,
Insured_Value_Accepted__c = False,
(OR(Insured_Value__c >= (RetailValue__c + ( RetailValue__c *10/100)),
Insured_Value__c <= (RetailValue__c - ( RetailValue__c *10/100))
)))
(2) Insured_Value__c & RetailValue__c
My validation rule:
IF(AND( Insured_Value__c = 0, RetailValue__c = 0),
False,
IF( OR(ISCHANGED(Insured_Value__c),ISCHANGED(RetailValue__c), ISNEW()) ,
IF(AND(AND(RecordType.Name <> 'abc',
RecordType.Name <> 'def',
RecordType.Name <> 'gh',
RecordType.Name <> 'ijk',
RecordType.Name <> 'lmn') ,
Insured_Value_Accepted__c = False,
(OR(Insured_Value__c >= (RetailValue__c + ( RetailValue__c *10/100)),
Insured_Value__c <= (RetailValue__c - ( RetailValue__c *10/100))
))), True, False) ,
false) )
Any assistance would be greatly appreciated!
I need assistance with a validation please.
The validation rule must fire, only when (1) criteria are met on a newly created records, or when any one of (2) two fields are changed, but not when the (2) two fields are both zero. It works fine on edited records, but not for new records. On new records the validation rule fires irrespective of whether the criteria are met
(1) AND(AND(RecordType.Name <> 'abc',
RecordType.Name <> 'def',
RecordType.Name <> 'gh',
RecordType.Name <> 'ijk',
RecordType.Name <> 'lmn') ,
Insured_Value_Accepted__c = False,
(OR(Insured_Value__c >= (RetailValue__c + ( RetailValue__c *10/100)),
Insured_Value__c <= (RetailValue__c - ( RetailValue__c *10/100))
)))
(2) Insured_Value__c & RetailValue__c
My validation rule:
IF(AND( Insured_Value__c = 0, RetailValue__c = 0),
False,
IF( OR(ISCHANGED(Insured_Value__c),ISCHANGED(RetailValue__c), ISNEW()) ,
IF(AND(AND(RecordType.Name <> 'abc',
RecordType.Name <> 'def',
RecordType.Name <> 'gh',
RecordType.Name <> 'ijk',
RecordType.Name <> 'lmn') ,
Insured_Value_Accepted__c = False,
(OR(Insured_Value__c >= (RetailValue__c + ( RetailValue__c *10/100)),
Insured_Value__c <= (RetailValue__c - ( RetailValue__c *10/100))
))), True, False) ,
false) )
Any assistance would be greatly appreciated!
I have the following points:
I hope it helps
Regards,
Deepak Rathinavelu
All Answers
I have the following points:
I hope it helps
Regards,
Deepak Rathinavelu
Thank you so much for your assistance!
line01. The validation should not fire if both the values are zero, irrespective of whether it is a new record or existing record.
line05. Could you please clarify what you mean with "can you check the default record type"?
line10. Correct
line11.This value is manually entered
Best regards,
Is the record type given specifically, when the new record is created. Cause if not the deafult record type is assinged, and that record type might be missing from the condition being checked.
Also when is the values given for:
Insured_Value_Accepted__c
Insured_Value__c
RetailValue__c
Cause, If the values are not given when the record is being created then the condition might be comparing zeros, which would also satify the condition.
Sample input for a new record would really be helpful.
Thanks.
Thank you for your valuable input and assistance!
I found a before insert trigger updating the RetailValue to 0 based on another field. So the user's value entered in this field was overwritten with a zero, which then subsequently fires the validation rule.
This had me stomped!
Thanks again!
Good to now that the issue is solved, can you change the status as such.
Thanks,
Deepak Rathinavelu