You need to sign in to do that
Don't have an account?
ronmis
Update Dependent Picklist values through apex code
Hi guys,
I have the following PickLists
Picklist_A
Values : 1, 2, 3, 4
Picklist_B
Values : L, M, N, O
Picklist_B is dependent on Picklist_A in this way
if 1 or 2 are selected from Picklist_A, Picklist_B will show L, M
if 3 or 4 are selected from Picklist_A, Picklist_B will show N, O
I'm trying to figure out how to write an apex method updatePickList() that will accept a string and add that to Picklist_B and make it dependent on Picklist_A 3,4
Thanks in advance
I have the following PickLists
Picklist_A
Values : 1, 2, 3, 4
Picklist_B
Values : L, M, N, O
Picklist_B is dependent on Picklist_A in this way
if 1 or 2 are selected from Picklist_A, Picklist_B will show L, M
if 3 or 4 are selected from Picklist_A, Picklist_B will show N, O
I'm trying to figure out how to write an apex method updatePickList() that will accept a string and add that to Picklist_B and make it dependent on Picklist_A 3,4
Thanks in advance
If i understood correct, you want to add one new picklist value in in picklist field Picklist_B above and want to make them dependent on Picklist_A value.
This looks like the metadata configuration change. I think it's not possible to do it using APEX such type of changes.
You can try to explore the tooling api. That may help in this scenario.
Thanks.
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_updateMetadata.htm
Only thing is this value which set by external system to picklist field, and not available in list of value, can not be used for other records when creating through user interface.
Please let me know if above help