+ Start a Discussion
Ankit Maini.Ankit Maini. 

force:inputField - Prepopulate the lookup field stopped working in summer 19.

I have used force:inputField on a lighting component and pre-populate the WhatID. Before summer 19, pre-populate was working fine, but it stopped working in summer19. Any woraround for this?
 
Component Code:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
 
<aura:attribute name="newTask" type="Task" default="{ 'sobjectType' : 'Task','Status':'Open', 'WhatId' : '' }" />

<div class="marginDiv forceInput">
       <div>Related To</div>
        <div><force:inputField aura:id="relatedTo" value="{!v.newTask.WhatId}"/></div>
 </div> 
</aura:component>



Controller:

({
doInit : function(component, event, helper) {
	var recId = component.get("v.recordId");
							var value = [{ 
							   type: 'My_Custom_Object__c', 
							   id: recId, 
							   label: "navigate", 
						   }]; 
						  
						  
						   if(component.find("relatedTo")){
							   component.find("relatedTo").get("v.body")[0].set("v.values", value); 
								
						   }
						   

					
	
	})
---------------------------------------------------------------------------------------------------------------

 
MagulanDuraipandianMagulanDuraipandian
Double check whether Related To field have that Custom Object in it.
--
Magulan Duraipandian
www.infallibletechie.com