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
Vanitha ManiVanitha Mani 

lightning combobox Urgent question

Hi,
I have lightning combox with filters depends on product value..
I am getting the picklist values in the form.
But when the product field is chnaged in case object..the picklist values are not getting refreshed and instead shows the values for old product value.

once value get selected..i should right to v.ticket.Feature_function__c

How to refresh the lightning combobox values:
Apex controller
 @AuraEnabled
     public static List<SVC_Feature_Function__c> getFeatureFunction(String productId){
         
        return [SELECT Id, Name FROM SVC_Feature_Function__c Where Product__c =:productId order by Name asc];
         
    }

Component:
 <lightning:combobox aura:id="newOpportunityField" fieldName="Feature_Function__c" label="Failure Point"
                        placeholder="Choose Failure Point"
                        value="{!v.ticket.Feature_Function__c}"
                        required="true"
                        dropdownAlignment="right"
                        variant="standard"
                        messageWhenValueMissing="Complete this field"
                        onchange="{!c.handleOptionSelected}"
                        options="{!v.featureOptions}"/>
js controller:
failurePointList: function(component, event, helper) {
        
       
        var action = component.get("c.getFeatureFunction");
        action.setParams({
            productId: component.get("v.ticket.Product__c")
        });
             action.setCallback(this,function(response){
                 var res = response.getReturnValue();
                 console.log('ticket object::'+JSON.stringify(response.getReturnValue()));
                 var state = response.getState();
                 if(state == "SUCCESS"){
                     var lables= [];
                     res.forEach(function(key) {
                         lables.push({"label":key.Name ,"value":key.Id});
                         
                     });
                     
                     component.set("v.featureOptions", lables);
                   
                 }
             });
             $A.enqueueAction(action);
           
    },

Can anyone help to refresh the values in picklist if product value changed in case object..