Related posts

  • Thane Tagg

    Great Post! Excellent way to get around the dependant picklists. Question though, for the Custom Metadata type everytime a new picklist is added will you need to update this dependancy?

    Also, it still feels strange salesforce hasn’t supported the standard picklist dependency into flows yet.

    Cheers,
    Thane

    • Thats right, Salesforce recently started supported even picklist. If we add any dependency then we need to keep Metadata Type updated.

  • Gautam Majumdar

    Hi Jitendra, I have situation where the dependency is with multiple levels. Say I have level 1, 2 and 3 picklists. Level 2 is dependent on level 1 ( this was easy) The next was, level 3 is dependent on level 2 and level 1. Does this solution help me set that up?

    • Yes this solution should help. However you will need new screen for each dependency.

  • Max Pyne

    Hi Jitendra…Thanks for sharing this post!
    You really saved me a lot of coding effort as I have upto 6 level of field dependency for my work…

    I have a some queries although..Will be really helpful if you provide your inputs

    1.Since different screens need to be used for different picklists…I was thinking to add user selected values to be displayed in subsequent screens as a read only textbox.
    Ex: There are screen 1-6. Screen 2 should display screen1 selection as readonly on top of picklist in screen2 and so on!!

    I am able to display them in text boxes but they are not read only.Can you help me out with that?
    I can always use validation rules but its not a good user experience!!

    2.In some cases , controlling field values are appearing more than once i.e. not unique and dependant field values change based on multiple level dependency and are appearing more than once in screen

    For Ex:

    Segment System Role
    Brand IPC Developer
    Corp IPC Developer
    Corp IPC Admin

    In this case , if you select Segment – Corp, you will find two same values for System – IPC and IPC again!!
    Is there a way to restrict it?

    2.Thirdly . I have 200+ records with multiple dependencies.
    Instead of manually creating records in Custom Metadata Type object , is there a way to mass load data in mdt?

    • Here my suggestions :
      1. Use a variable to store value selected in previous screen and simply display variable on screen. It would be readonly.

      2. You can restrict it by making sure that Custom Metadata does not has duplicate entry in it. Otherwise you will need to use Javascript and beauty of click over code would be lost 🙂

      3. There is Custom metadata Dataloader, use it from here – https://github.com/haripriyamurthy/CustomMetadataLoader