0

I'm working on a case where I want to show picklists in design attributes. Here, in my case, I want to show them dynamically. i.e. let us take that there 2 picklists in design attributes, first to select parent and the second to select child element. When I select Account in first picklist, the second picklist should show only the object names having lookup to Account. I was trying out code, but my code is limited only to the current picklist, is there a way that I can have dependent picklists?

Here is my code.

global class MyCustomPickList extends VisualEditor.DynamicPickList {
  global override VisualEditor.DataRow getDefaultValue() {
    VisualEditor.DataRow defaultValue = new VisualEditor.DataRow('account', ' Account');
    return defaultValue;
  }

  global override VisualEditor.DynamicPickListRows getValues() {
    VisualEditor.DataRow value1 = new VisualEditor.DataRow('account', 'Account');
    VisualEditor.DataRow value2 = new VisualEditor.DataRow('contact', 'Contact');
    VisualEditor.DynamicPickListRows myValues = new VisualEditor.DynamicPickListRows();
    myValues.addRow(value1);
    myValues.addRow(value2);
    return myValues;
  }
}

Please let me know how I achieve this dynamic dependent design attributes.

Thanks

0

Unfortunately, this is not possible. You'll want to vote on this Idea.

| improve this answer | |

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.