• Shagufta Noori
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
<aura:attirbute name="LeadObj" type="Lead"/>
<lightning:recordEditForm objectApiName="Lead" >
    <lightning:inputField aura:id="accid" fieldName="Account__c" value="{!v.LeadObj.Account__c}" label="Attribute" onchange="{!c.myChangeAcc}"/>
</lightning:recordEditForm>



controller.js

mychangeAcc:function(component,event,helper){
var acc=component.find('accid').get('v.value');
alert(acc);
var action = component.get("c.LeadAccountInfo");

        action.setParams({ldvalue:acc});

}

apex class:

@AuraEnabled
    public static string LeadAccountInfo(Id ldvalue){
Account ac=[select id,Name from Account where Id =:ldvalue limit 1];
        return ac.Name;
}

Hi All ,here in thee above acode it is not passing parameter to apex class. if i test with harcoded id its working 

can anyone help

Thanks,
Billing Badge