You need to sign in to do that
Don't have an account?
Validation rule with AND and OR statements not working
I have a VR written to require the user to enter the Contract Term # of Months, once the opportunity in a particular record type reaches a certain stage (stage 6) or higher.
However, its not working - any ideas?
Here is the formula as it stands now:
AND (
OR (
ISPICKVAL(StageName, "6 - Proposal/MOU Presented"),
ISPICKVAL(StageName, "7 - Verbal Acceptance"),
ISPICKVAL(StageName, "8 - Contract Sent/Negotiations"),
ISPICKVAL(StageName, "9 - Contract Executed"),
ISPICKVAL(StageName, "10 - Contract Validated "),
ISPICKVAL(StageName, "11 - Internal Kickoff Completed"),
ISPICKVAL(StageName, "12 - Customer Kickoff Completed"),
ISPICKVAL(StageName, "13 - Integration Instructions Sent"),
ISPICKVAL(StageName, "14 - Certification Complete"),
ISPICKVAL(StageName, "15 - Approved for Production"),
ISPICKVAL(StageName, "16 - Launched to Production")),
RecordType.Id="01280000000Luw9AAC",
ISBLANK(Contract_Term_Months__c)
)
[cid:image007.png@01CE8C46.A8466C70]
Jane Isaac
Director, Digital Global Sales Operations
w 401.886.4052
m 401.447.7745
digital.incomm.com
[cid:image002.png@01CE7E54.1D796250] [cid:image003.png@01CE7E54.1D796250] [cid:image004.png@01CE7E54.1D796250]
All Answers
Also, your use of recordtype.id is curious as the field in the Oppo is recordtypeId. So I did an experiment and it seems you can refer to recordtype.developername = 'foo' and thus avoid the hard coded ids which are not very transparent for maintenance
note that debugging VR can be done using debug logs which are handy way to see if the values in your object are what you expect
I double checked the fields (stage name) to make sure I had typed it in exactly - the one I am testing is at Stage 8 and the field Contract Term # of Months is empty.
Any other ideas?
AND (
OR (
ISPICKVAL(StageName, "6 - Proposal/MOU Presented"),
ISPICKVAL(StageName, "7 - Verbal Acceptance"),
ISPICKVAL(StageName, "8 - Contract Sent/Negotiations"),
ISPICKVAL(StageName, "9 - Contract Executed"),
ISPICKVAL(StageName, "10 - Contract Validated "),
ISPICKVAL(StageName, "11 - Internal Kickoff Completed"),
ISPICKVAL(StageName, "12 - Customer Kickoff Completed"),
ISPICKVAL(StageName, "13 - Integration Instructions Sent"),
ISPICKVAL(StageName, "14 - Certification Complete"),
ISPICKVAL(StageName, "15 - Approved for Production"),
ISPICKVAL(StageName, "16 - Launched to Production")),
RecordType.DeveloperName = "Regional Merchant",
ISNULL(Contract_Term_Months__c)
)
I've worked through this logic a couple of times and I don't see a problem... what you have written is logically equivalent to saying something like "if the record type is x and the stage is greater than or equal to six, then the Contract_term_months_c field must be filled." Is there any case you can find where the rule does fire?
[cid:image007.png@01CE8C46.A8466C70]
Jane Isaac
Director, Digital Global Sales Operations
w 401.886.4052
m 401.447.7745
digital.incomm.com
[cid:image002.png@01CE7E54.1D796250] [cid:image003.png@01CE7E54.1D796250] [cid:image004.png@01CE7E54.1D796250]
Jane - please mark as solved; also note that SFDC encourages ISBLANK() rather than ISNULL() as best practice.