You need to sign in to do that
Don't have an account?
SFDCDoctorStrange
not Showing all values in Lightning Component Picklist
My lightning component all the picklist values from the related object
Aura Component
Aura Hepler
Aura Controller
please check and help me with the issue
thanks in advance
Himanshu
Aura Component
<div class="four wide column"> <label for="category-dropdown"><b>Select Category</b></label> <select id="category-dropdown" label="Category" class="ui small fluid selection dropdown"> <option value="{!v.defaultCategory}">--None--</option> <aura:iteration items="{!v.categoryOptions}" var="category"> <option value="{!category}">{!category}</option> </aura:iteration> </select> </div>
Aura Hepler
({ enableCategoryValues: function(component){ let action = component.get('c.getCategoryValues'); action.setParams({ 'recordId': component.get('v.recordId') }); action.setCallback(this, function(response){ let state = response.getState(); if(state === 'SUCCESS') { component.set('v.categoryOptions', response.getReturnValue()); component.set('v.catgoryFilterEnabled', true); }else{ console.error(JSON.stringify(response.getError())) } }) $A.enqueueAction(action) }, })
Aura Controller
@AuraEnabled public static List<String> getCategoryValues(String recordId) { List<String> catregories = new List<String>(); Schema.DescribeFieldResult fieldResult = SVMXC__Service_Order__c.Category__c.getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); for( Schema.PicklistEntry pickListVal : ple){ catregories.add(pickListVal.getValue()); } //catregories.sort(); system.debug('catregories : '+catregories); List<String> hasValueCategory = new List<string>(); Set<String> categorySet = new Set<String>(); List<sharinpix__SharinPixImage__c> sharinPixImageList = [select Id, sharinpix__AlbumID__c, sharinpix__ImagePublicId__c, Landscape_Portrait__c, sharinpix__FileName__c, sharinpix__ImageURLOriginal__c, Image_Thumbnail_F__c, sharinpix__ImageURLFull__c , CreatedDate, sharinpix__Tags__c, Work_Order__c, Work_Order__r.IP_Templates_Type__c, Work_Order__r.SVMXC__Component__c, Work_Order__r.Name, Work_Order__r.Start_Date_Time__c, sharinpix__Width__c, sharinpix__Height__c,sharinpix__Title__c, Image_Name__c, Work_Order__r.Category__c from sharinpix__SharinPixImage__c where sharinpix__AlbumID__c != null AND (NOT sharinpix__Tags__c LIKE '%After%') AND (NOT sharinpix__Tags__c LIKE '%Before%') AND (NOT sharinpix__Tags__c LIKE '%Time-Hrs%') AND Work_Order__r.SVMXC__Component__c =: recordId AND Work_Order__r.Category__c =: catregories ORDER BY Work_Order__r.Start_Date_Time__c, sharinpix__FileName__c, sharinpix__SortPosition__c]; if(sharinPixImageList != null){ for(sharinpix__SharinPixImage__c pix : sharinPixImageList){ if(pix.Work_Order__r.Category__c != null){ categorySet.add(pix.Work_Order__r.Category__c); } } } hasValueCategory.addAll(categorySet); return hasValueCategory; }
please check and help me with the issue
thanks in advance
Himanshu
All Answers
we are using same component for the app and object