Search code examples
salesforcesalesforce-lightningsalesforce-communitiesaura-framework

I want to enable the sObject picklist field on selection of Type picklist otherwise it's disabled


As you can see in photo in Type picklist field when i select salesforce sObject only that time i'm able to select Sobject type picklist otherwise it's disabled. enter image description here

like this other filed is selected or none then sObject Picklist field is disabled we can't select it. enter image description here


Solution

  • Just added this on controller

      onChageType:function(component){
        var val = component.get("v.type");
        // console.log('type',val);
        if(val == 'Salesforce sObject'){
            component.set('v.isActive',false);
        }
        else{
            component.set('v.isActive',true);
            component.set("v.selectSojbect",'');
        }
    },