1

Hi Friends i'm new to development.I got a requirement to create a dependency between multipicklist in standard object page.

I have two Multi picklist in standard object CASE.But the controlling field is dependent on another picklist.

I had created a visual force page for dependency.I created dependency between picklist. But i can't create a dependency between multipicklist.

I tried so many solutions but till now didn't work anything.

Please provide any suggestion to complete my requirement.

4

I think you've run into a documented limitation of multi-select picklists. Multi-select picklists can be dependent picklists but not controlling fields. That would be why you can't use the multi-select values to create another dependency. See Dependent Picklist Considerations.

1

Adding few points to @crmprogdev answer. It is not possible to use dependency in multiselect picklist. But you can try something similar in custom VF page.

Just create a Map<String, set<string>> in key store Parent picklist value and value store the child picklist value. Now when any user select parent picklist value rerender the section and get value from map and add them in child picklist field.

You can override the standard Edit page to use this functionality. But keep in mind that this is not a fool-proof solution and any user with basic development skills can by pass this approach.

But for security and if your picklist value are fixed you can take help of validation rule to prevent user to enter wrong combination. Something like if(Parent_A includes('parA') and Child_B includes ('test, test2'), false, true)

Update: In this case you can use trigger on before insert, before update so it will look like

if(parent value == 'A')
{
  if(child value != 'A' && child value != null) //remove null if you want second picklist required
    sob.addError('Wrong value')
}
else if(parent value == 'B')
{
  if(child value != 'B' && child value != null) //remove null if you want second picklist required
    sob.addError('Wrong value')
}
  • We already mentioned to the user about validation rule.But The picklist have lot of values.So it's difficult to the user select specific value.@Tushar Sharma.Do you have related code example or anything to suggest. – Pavan tej Jun 13 '16 at 13:02
  • @Pavantej check my updated answer. – Tushar Sharma Jun 14 '16 at 13:47

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.