You need to sign in to do that
Don't have an account?
billing badge
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
how to pass lightning:inputfield onchange value to apex controller
<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
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/
its not working stil
Error message: Value provided is invalid for action parameter 'ldvalue' of type 'Id'
For Latest हिंदी में सरकारी नौकरी तथा सरकारी योजनाएं (https://www.sarkarisamachar.in/)
@AuraEnabled public static string LeadAccountInfo(String ldvalue)
{
Account ac=[select id,Name from Account where Id =:ldvalue limit 1];
return ac.Name;
}
Thanks Yogesh