1

While developing salesforce lightning component, we faced a weird issues. As you know till now we cannot directly use salesforce picklist field as a standard input field in LC, so as a workaround we have to create our own ui:selectlist

Now, while creating same, we added almost 500 picklist values in a single component for country and currency. This stops the component to load. It gives an error of "Event Fired".

Anyone faced something similar? We are using lightning components in Napili Template.

0

You should create custom field for picklist and add those entries to the picklist. Now create schema to get these picklist values in your lightning component. Here I am creating a schema to get lead status in picklist and calling this method from aura init function-

 public static List<String> getLeadStatus(){
    List<String> options = new List<String>();
    Schema.DescribeFieldResult fieldResult = lead.status.getDescribe();
    List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    for (Schema.PicklistEntry f: ple) {
        options.add(f.getLabel());
    }

    return options;}

Let me know if you need more information.

  • This makes sense AJAY. Let me try out this! – Pratik Bagadia Jul 27 '16 at 10:56

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.