function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDCDoctorStrangeSFDCDoctorStrange 

not Showing all values in Lightning Component Picklist

My lightning component all the picklist values from the related object 

User-added imageUser-added image

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
Best Answer chosen by SFDCDoctorStrange
MagulanDuraipandianMagulanDuraipandian
It is returning values based on the records fetched from sharinpix__SharinPixImage__c object. If you want to return all the values, then use catregories instead of hasValueCategory.

All Answers

SFDCDoctorStrangeSFDCDoctorStrange
And also Its not displaying any Picklist values in App
we are using same component for the app and object 
User-added image
MagulanDuraipandianMagulanDuraipandian
It is returning values based on the records fetched from sharinpix__SharinPixImage__c object. If you want to return all the values, then use catregories instead of hasValueCategory.
This was selected as the best answer