I am trying to auto populated a lookup field using the force:inputfield but its not working, is there some specific way to populating as other types of field are working fine like picklist, text, date & checkbox
Here is the code
Component
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="Id"/>
<aura:attribute name="account" type="Account" default="{ 'sobjectType': 'Account' }"/>
<!-- lookup to lead on account object -->
<force:inputField aura:id="accNe2" value="{!v.account.Lead__c}"/>
Here is the controller
doInit: function(component) {
var action = component.get("c.getAccountFieldValues");
action.setParams({ recordId : component.get("v.recordId") });
action.setCallback(this, function(actionResult) {
var infos = actionResult.getReturnValue();
component.set("v.account", infos);
});
$A.enqueueAction(action);
},
And the apex method has normal SOQL returning account record.
Lead__c
field?