I am trying to set the value of a 'force:inputField' lookup field dynamically, but it is not working. On click of the edit button, the record edit page gets open, but the Account value does not get set. All other values are getting set. But we have a problem for the force:inputField lookup field.
We have tried out the workaround given in the following the link: https://help.salesforce.com/articleView?id=000322074&language=en_US&type=1&mode=1 But this is not working.
Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,lightning:actionOverride" access="global" > <aura:attribute name="opportunity" type="Opportunity" default="{ 'sobjectType': 'Opportunity' }"/><aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <div class="slds-form-element__control"><force:inputField class="form-control" aura:id="account_name" value="{!v.opportunity.AccountId}" /> </div></aura:component>
Controller:
doInit: function(component, event, helper) { var value = [{ type: 'Account', id: "0015400000GldOZAAZ", label: "navigate", }]; component.find("account_name").get("v.body")[0].set("v.values", value); }
How to resolve this issue?