+ Start a Discussion
Ankit Singh 6Ankit Singh 6 

Need to update validation rule for Apex

There is a validation which ensures that country to be added when a new contact is created. If country is not present, it gives error for new contact.
ISBLANK(Country)

Now we want to ignore this validation for a particular account or you can say for a LeadSource. Please let me know how could I achieve that.
I have tried below rule but it did not work.

NOT(ISPICKVAL(LeadSource, "DiscoverOrg")) && 
ISBLANK(Country)
David ZhuDavid Zhu
You may change to single quotation mark.

NOT(ISPICKVAL(LeadSource, 'DiscoverOrg')) && 
ISBLANK(Country)
Ankit Singh 6Ankit Singh 6
Hi

I tried replacing double quotes to single, but still it did not work. Could you please provide any other workaround so that I can bypass the Country check for 'DiscoverOrg' leadsource.
 
David ZhuDavid Zhu
I tested on Lead and it worked.