You need to sign in to do that
Don't have an account?
Sienna Luard 3
Validation rule to make a picklist field mandatory for Closed Opps that are a certain Record Type
I Validation rule to make a Multi-select picklist field (Competitors) mandatory for Closed Opps that are a certain Record Type (Initial Opportunity. I am using this formula.
AND
(IsClosed = TRUE,
( RecordType.DeveloperName ="Initial Opportunity"),
ISBLANK(
TEXT( Competitors__c ))
)
I get no syntax errors, but when I close an Opp there is no error msg.
Any ideas>
AND
(IsClosed = TRUE,
( RecordType.DeveloperName ="Initial Opportunity"),
ISBLANK(
TEXT( Competitors__c ))
)
I get no syntax errors, but when I close an Opp there is no error msg.
Any ideas>
Can you update below
You need to use API name of record type if you are using 'RecordType.DeveloperName'. If you are using a label name then use 'RecordType.Name'
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
I am made the following update and the validation rule is still not firing.
AND
(IsClosed = TRUE,
( RecordType.Name = "Initial_Opportunity"),
ISBLANK(
TEXT( Competitors__c ))
)
What am I missing?
Try below, I tested from my end and its working. Thanks,
Vinay Kumar
Our Competitors__c field is a multi-select picklist field so I got the message "Error: Field Competitors__c is a picklist field. Picklist fields are only supported in certain functions."
I added TEXT back and change to single quotes around Initial Opportunity and tried this.
AND
(IsClosed = TRUE,
( RecordType.Name = 'Initial_Opportunity'),
ISBLANK(
TEXT( Competitors__c ))
)
The Validation Rule still does not fire.
Strange and not sure why it's not working in your case and it's working I have used multi-select picklist.
Can you try to check both scenarios "RecordType.Name = 'Initial_Opportunity' 'and RecordType.Name = 'Initial Opportunity' ".
Run below SOQL query Pick the opportunity id which has IsClosed=true and record type = 'Initial Opportunity'.
Thanks,
Vinay Kumar
AND(
ISPICKVAL( StageName ,'Closed Won'),
RecordTypeId = '01270000000Hpxb',
ISNULL(Competitors__c )
)
Review below formula as well and it should work as well as it worked in my org. Thanks,
Vinay Kumar