You need to sign in to do that
Don't have an account?
Sarita Pa 3
How to get account Id from opportunity in lightning
Can you help me in getting the information in below scenario.
I need to pass parameters to an action in lightning like opportunity id, account id. where Account Object is a look up in Opportunity. I am getting opportunity record Id but could not able to get the account Id in the controller
I need to pass parameters to an action in lightning like opportunity id, account id. where Account Object is a look up in Opportunity. I am getting opportunity record Id but could not able to get the account Id in the controller
Please find the code below
I am getting the record id of opportunity correctly. I am trying to get the account id which is associated with this opportunity id.by adding the code in controller like
simple way is to use Lightning Data service below is sample code which will give you the accountId of opportunity .
** Note : In Javascript the values and variables are case-sensitive .
I tried with the above approach and it is fetching the results only in the component. But not able to get the details in the controller.
to call the controller I am using
<aura:handler name="init" value = "{ ! this}" action="{!c.doInit}
but the results are not getting for any of the other fields.