You need to sign in to do that
Don't have an account?
Abhi92
Validation Rule on AccountNumber
I've created a below validation rule on Account, but it's not firing when the length of the Account number is not 8, record getting saved even length is 5 number. What wrong I'm doing ??
AND(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber)),
LEN(AccountNumber) <> 8
)
AND(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber)),
LEN(AccountNumber) <> 8
)
Your formula should be:
OR(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber)),
LEN(AccountNumber) <> 8
)
All Answers
Your formula should be:
OR(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber)),
LEN(AccountNumber) <> 8
)
Your query is answered in the above official document.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
Thanks Ritu, I've already replaced that and it's working. But I'm confused now between AND and OR.
AND function - Checks whether all arguments are true and return TRUE if all arguments are true, it should fire the validation error if any of the criteria is not satisfying.
OR function - this check whether any of the arguments are true and returns TRUE or FALSE. Returns FALSE only if all arguments are false
Please can you help me out with this.
Please select my answer as the best answer if your problem is resolved. That would help others in future.
AND( ISBLANK(AccountNumber),
LEN(AccountNumber) <> 7 )
LEN(AccountNumber) <> 7 )
This will throw error if both the conditions are true i.e. account number is blank and length is not blank. But as per your requirement, OR is needed.
Double-check the syntax of your validation rule to make sure it is correct. You can do this by going to Setup > Object Manager > Account > Validation Rules and clicking on the rule you created. Make sure the formula is correct and there are no errors.
Verify that the validation rule is active. Go to Setup > Object Manager > Account > Validation Rules and make sure the checkbox next to the rule you created is checked.
Check the evaluation criteria for the validation rule. Make sure it is set to "Formula evaluates to true" and that the formula is correct.
Verify that the Account Number field is a required field. If the field is not required, the validation rule may not be triggered when the field is left blank.
Make sure you are testing the validation rule correctly. (https://apksplash.com/) When creating or editing an Account record, enter a value in the Account Number field that is not 8 characters long and try to save the record. If the validation rule is working correctly, you should see an error message preventing the record from being saved.
If you have checked all of the above and the validation rule is still not firing correctly, you may need to contact Salesforce support for further assistance.
Kahoot Login (https://kahoot-login.info/" target="_blank)