+ Start a Discussion
Mandar Kulkarni 13Mandar Kulkarni 13 

I want all users(Names) in my multiselect picklist on custom lightning page.

I m working on one project in which i have created custom lightning page to add new account i.e Registration from.So in registration from they want one multipicklist field named "Assigned To" to assign task after account is created.
Now problem is only that i m not getting users in that multipicklist(In Lightning)????
Amit Singh 1Amit Singh 1
what code are u using for showing multi picklist? Share all related code Only user mulipicklist part. Component code. JS code, apex code.
Mandar Kulkarni 13Mandar Kulkarni 13
Component - 
 <ui:inputSelect labelClass="slds-form-element__label" 
                                            multiple="false" class="multiple" required="true"
                                            aura:id="AssignMultiselect" value="v.account.Assigned_To__c" 
                                <aura:iteration items="{!v.users}" var="nameItem">
                                    <ui:inputSelectOption text="{!nameItem}" 

Controller - 
onMultiAssignChange : function(cmp, evt) {
        var selectCmpAssign = cmp.find("AssignMultiselect");
        var resultCmpAssign = cmp.find("multiAssign");
        resultCmpAssign.set("v.value", selectCmpAssign.get("v.value"));
        var assignedValues = selectCmpAssign.get("v.value");
        // var str = 'Hello, World, etc';
        var assigned_array = assignedValues.split(';');
        for (var i = 0; i < assigned_array.length; i++) {
            // Trim the excess whitespace.
            assigned_array[i] = assigned_array[i].replace(/^\s*/, "").replace(/\s*$/, "");
        assigned_array.splice(0, assigned_array.length);