You need to sign in to do that
Don't have an account?
Kumar Saurav 16
I am a newbie in salesforce and eager to get familiar with this platform. Can someone clarify me as to why we begin writing a validation rule with OR, AND , NOT? Further more, why do we need to use them. Can we not simply use keywords like 'IF' to mention a condition, in oreder to validate our code or application module?
Thanks in advance.
When to use 'OR', 'AND', NOT while writing a validation rule
I am a newbie in salesforce and eager to get familiar with this platform. Can someone clarify me as to why we begin writing a validation rule with OR, AND , NOT? Further more, why do we need to use them. Can we not simply use keywords like 'IF' to mention a condition, in oreder to validate our code or application module?
Thanks in advance.
done we understand with it by a simple Account Address Validation Rules
when you create validation rules with multiple conditions you need to use these Operators
let assumewe want Validates that the account Billing State/Province is a valid two-character abbreviation if Billing Country is CA or CAN.
so it write like that
explain-:
AND() = Returns a TRUE response if all values are true; returns a FALSE response if one or more values are false. Use this function as an alternative to the operator && (AND).
ex-: IF(AND(Price<1,Quantity<1),"Small", null)
OR() = Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false. Use this function as an alternative to the operator || (OR).
ex-: IF(OR(ISPICKVAL(Priority, "High"), ISPICKVAL(Status, "New")), ROUND(NOW()-CreatedDate, 0), null)
NOT() = Returns FALSE for TRUE and TRUE for FALSE.
ex- : IF(NOT(ISPICKVAL(Status, "Closed")), ROUND(NOW()-CreatedDate, 0), null
Thanks
i hop its helps you
All Answers
hi Kumar
you got your answer below link
https://help.salesforce.com/HTViewHelpDoc?id=fields_validation_rules_tips.htm
Thanks
Please mark it best answer if it helps you :)
done we understand with it by a simple Account Address Validation Rules
when you create validation rules with multiple conditions you need to use these Operators
let assumewe want Validates that the account Billing State/Province is a valid two-character abbreviation if Billing Country is CA or CAN.
so it write like that
explain-:
AND() = Returns a TRUE response if all values are true; returns a FALSE response if one or more values are false. Use this function as an alternative to the operator && (AND).
ex-: IF(AND(Price<1,Quantity<1),"Small", null)
OR() = Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false. Use this function as an alternative to the operator || (OR).
ex-: IF(OR(ISPICKVAL(Priority, "High"), ISPICKVAL(Status, "New")), ROUND(NOW()-CreatedDate, 0), null)
NOT() = Returns FALSE for TRUE and TRUE for FALSE.
ex- : IF(NOT(ISPICKVAL(Status, "Closed")), ROUND(NOW()-CreatedDate, 0), null
Thanks
i hop its helps you
I need your help in writing a validation rule for the below scenario-
Object Name: Asset
The custom field name where validation rule needs to be written: AssetName__c
Logic: The Asset Name field is required if Asset_Type__c is X3rd_Party_Assets__c or N_A_Assets__c, else blank
I really appreciate your quick help.
Many thanks,
Sam