18 Comments

  1. Hi, sorry for being dense, I’m not an experienced developer, but how do you adapt for multi-level dependencies? Like what if you are working with up two four levels of dependent picklists?

    • Hello, What you need to do is start working on one dependency at one level at a time and once the first level dependency is completed then start working on the second level dependency and so on. Hope this will help you to achieve multi-level dependency.

  2. Hi @sfdc panther,

    Here i am also having a scenario, where i am having dependent picklist consists of 1200K values , and parent picklist is having 450+ values, is still can be achieved?
    Do i need to add all the values to be existed in the picklist before i proceed to implement the code?

    • 1200K unique picklist values? Are you serious? Salesforce will not let you to have that much picklist inside a single field.But yes the above code will work

  3. Yes, We had extended the limit of picklist values by raising a case. What if i have mapped few values and others need to be mapped. But few values i already inserted through workbench but did not mapped.

  4. Hello, I have followed all the steps, but I receive this error:

    Web service callout failed: Failed to get next element
    Error is in expression ‘{!updatePicklistField}’ in component in page uploadpicklistdependant: Class.MetadataService.MetadataPort.updateMetadata: line 13255, column 1
    Class.MetadataPicklistController.updatePicklistField: line 72, column 1

    Could you please help me?
    Thanks in advance.
    Regards,
    Rosario

  5. Hi, does this code need to be migrated into production for this to work once it has gone live? Or can this all be done in a Dev environment and then you just migrate the dependency as you usually would? Just keen to keep the code down in Production.

  6. Hi, how do you prepare the map in step 4? When I run the VF, I never get confirmation that picklist values have been updated.

  7. Hi!! Thanks for the tutorial!!

    Just a couple of questions:
    – This worked flawlessly if the controlling and dependent picklists have their own values, but what if they get the values for a Global Picklist? In that case, I get this error in the debug logs: “|DEBUG|Cannot set picklist values when a global picklist is referenced on the field.”. Should then the code be extended to not only call the Metadata API with the CustomField, but with the GlobalValueSet as well?
    – Also, another question. Can this code be extended to also autonomously create beforehand picklist values in Salesforce if in the CSV appear some values that do not exist in the picklist field /Global Value Set in Salesforce?

    Finally, is there any reference in the code or how to user Custom Setting/Metadata instead of CSV?

    Thanks again for the help and the idea!

    • Hello Josemi,

      1. Currently the code only uses the picklist values which are being reference from the field not from Global Picklist
      2. No, we are not creating any picklist values.

      At present this code only uses CSV not custom metadata/settings

  8. Hi thanks for the tutorial !!
    Getting an error regarding “Web service callout failed: Unable to find apex schema info” Can you please help me out with that my requirement is on urgent basis .
    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Panther Schools

Subscribe now to keep reading and get access to the full archive.

Continue reading