2

Note: in standard page layout

is it possible to write a validation rule to make a field enabled or disabled based on picklist value?

i have a picklist - values

             cycle - monthly
                     quaterly
                     semi annual
                     annual
                     other

if picklist value is other a text field days has to be enabled

how can i achieve this?

thanks in advance

3 Answers 3

3

You can use the validation rule to make sure that the record cannot be saved unless the Days text field is filled in if the picklist value is 'other'.

AND(
    ISPICKVAL(Cycle__c, "other"),
    ISBLANK(Days__c)
)

This will give the user an error if they try to save a record where the picklist value os other and the days field is left blank.

You cannot though control whether or not the days field is enabled though. You would need a visualforce page to accomplish this functionality.

1
  • In addition to that, you would also need the reverse validation rule to block off users filling in Days__c when Cycle__c is not "Other", thus effectively disabling the field. Oct 8, 2014 at 12:35
0

I would like to add to SFDC_NINJA answer you can also show and hide the days field with field dependency feature.

1
  • This is not possible with a text field though, which is what Days__c seems to be. Oct 8, 2014 at 12:37
0

Sorry for replying to a very old thread, but if people are still wanting Salesforce to add this feature, please upvote the idea in the Success Community. 10 points / vote.

https://success.salesforce.com/ideaView?id=08730000000kzVyAAI

0

You must log in to answer this question.

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