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, "" )  
  • 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/… – AtulRajguru9 May 29 '14 at 9:31
  • Have you tried anything so far for us to build/advise on? – Simon Lawrence May 29 '14 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 '14 at 10:08
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)
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.