1

I need some help creating a basic validation rule

Aim – If field name “Client_Business_Type” contains “pension” then field name “Pension_Fund_Type” is mandatory

Field Label : Type of money Field Name : Client_Business_Type Api : Client_Business_Type__c Data type : Picklist

Field Label : Pension Fund Type Field Name : Pension_Fund_Type Api : Pension_Fund_Type__c Data type : Picklist

I have currently tried following validation rule. which works fine. However, instead of listing each pension from within the picklist. Is there anyway i can do a wildcard search for the word pension in the picklist value?

If I add more picklist values that contain the word 'Pension', I don't want to have to adjust the validation rule. Is there any way to find any picklist value that contains the word 'Pension'?

ISPICKVAL( Client_Business_Type__c , "Pension Fund - Public sector") && ISPICKVAL( Pension_Fund_Type__c, "" )  
3
  • 1
    Why dont you just follow the examples provided by SFDC and try create your validation rule. If you face any problem then post it here. help.salesforce.com/… May 29, 2014 at 9:31
  • Have you tried anything so far for us to build/advise on? May 29, 2014 at 9:45
  • 1
    i have the following validation rule. which works fine. However, instead of listing each pension from within the picklist. Is there anyway i can do a wildcard search for the word pension ? ISPICKVAL( Client_Business_Type__c , "Pension Fund - Public sector") && ISPICKVAL( Pension_Fund_Type__c, "" )
    – Masond3
    May 29, 2014 at 10:08

1 Answer 1

1

You could just use the CONTAINS() function along with the TEXT() function. Something like this should work for any picklist value that has the word pension in it.

AND(    
    CONTAINS(TEXT(Client_Business_Type__c), LOWER('pension')),
    ISBLANK(TEXT(Pension_Fund_Type__c)
)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .