function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nehru komuNehru komu 

force: inputfield is not working properly for lookup fields inside the aura:iteration

Naveen KNNaveen KN
Hi Nehru, add more details with code about the issue and I recommend to use the lightning base components like lightning:input instead of force:inputfield 

Naveen
Nehru komuNehru komu
yes i used lightning: inputfield is not working
<aura:iteration items="{!v.ConitemList}" var="item">
                    <!--<lightning:recordEditForm
                                          onload="{!c.itemhandleLoad}"
                                          onsubmit="{!c.itemhandleSubmit}"
                                          onsuccess="{!c.itemhandleSuccess}"
                                          aura:id="itemid"
                                          objectApiName="CERM__Contract_Item__c">
                    <lightning:messages /> 
                    <tr class="slds-text-title_caps">
                        
                        <td valign="top">
                            <lightning:inputField aura:id="itemacc" fieldName="CERM__Account__c" value="{!v.item.CERM__Account__c}"/> <br/>
                        </td >
                        <td IconName="custom:custom17" valign="top">
                            <lightning:inputField aura:id="lookup"  fieldName="CERM__Business_Location__c" value="{!v.item.CERM__Business_Location__c}"/> <br/> 
                            
                        </td>
                        <td valign="top">
                            <lightning:inputField aura:id="lookup" fieldName = "CERM__Commodity__c" value="{!v.item.CERM__Commodity__c}"/> <br/> 
                        </td> 
                        <td valign="top">
                            <lightning:inputField  fieldName = "CERM__Quantity__c" value="{!v.item.CERM__Quantity__c}"/> <br/>
                        </td> 
                        <td valign="top">
                            <lightning:inputField aura:id="lookup" fieldName = "CERM__UoM__c" value="{!v.item.CERM__UoM__c}"/> <br/>
                        </td> 
                        <td valign="top">
                            <div class="slds-truncate" ><lightning:inputField  fieldName = "CERM__DeliveryStartDate__c" value="{!v.item.CERM__DeliveryStartDate__c}"/></div>
                        </td>
                        <td valign="top">
                            <div class="slds-truncate" IconName="standard:currency" >
                                <lightning:inputField class="slds-input" fieldName= "CERM__DeliveryEndDate__c" value ="{!v.item.CERM__DeliveryEndDate__c}"/>
                            </div>
                            
                        </td>
                        <td valign="top">
                            <div class="slds-truncate" >
                                <lightning:inputField class="slds-input"  fieldName= "CERM__FuturesMonth__c" value="{!v.item.CERM__FuturesMonth__c}"/>
                            </div>
                        </td>
                        <td >
                            <lightning:inputField  fieldName="CERM__GoverningGrades__c" value="{!v.item.CERM__GoverningGrades__c}"/> <br/>
                        </td> 
                        <td valign="top">
                            <div valign="top">  
                                <lightning:inputField  fieldName="CERM__GoverningTerms__c" value="{!v.item.CERM__GoverningTerms__c}"/> <br/> 
                            </div>
                        </td> 
                        <td valign="top">
                            <div>
                                <lightning:inputField fieldName="CERM__Governing_Weights__c" value="{!v.item.CERM__Governing_Weights__c}"/> <br/> 
                            </div>
                        </td>
                    </tr>
                    </lightning:recordEditForm> 
                </aura:iteration>
Nehru komuNehru komu
instead of above code i have tried this code also.
<aura:attribute name = "ConitemList" type=conitem__c />
<aura:iteration items="{!v.ConitemList}" var="conitem">
<tr class="slds-text-title_caps">
       
        <td valign="top">
              <force:inputField aura:id="lookup"  value="{!v.conitem.CERM__Account__c}"/> <br/>
        </td >
        <td IconName="custom:custom17" valign="top">
            <force:inputField aura:id="lookup"   value="{!v.conitem.CERM__Business_Location__c}"/> <br/> 

        </td>
        <td valign="top">
            <force:inputField aura:id="lookup" value="{!v.conitem.CERM__Commodity__c}"/> <br/> 
        </td> 
        <td valign="top">
            <force:inputField  value="{!v.conitem.CERM__Quantity__c}"/> <br/>
        </td> 
         <td valign="top">
            <force:inputField aura:id="lookup"  value="{!v.conitem.CERM__UoM__c}"/> <br/>
        </td> 
        <td valign="top">
            <force:inputField  value="{!v.conitem.CERM__DeliveryStartDate__c}"/>
        </td>
        <td valign="top">
            <force:inputField  class="slds-input"  value="{!v.conitem.CERM__DeliveryEndDate__c}"/>
            
        </td>
        <td valign="top">
            <force:inputField  class="slds-input"  value="{!v.conitem.CERM__FuturesMonth__c}"/>
        </td>
        <td >
            <force:inputField value="{!v.conitem.CERM__GoverningGrades__c}"/> <br/>
        </td> 
        <td valign="top">
            <div valign="top">  
                <force:inputField  value="{!v.conitem.CERM__GoverningTerms__c}"/> <br/> 
            </div>
        </td> 
        <td valign="top">
            <div>
                <force:inputField  value="{!v.conitem.CERM__Governing_Weights__c}"/> <br/> 
            </div>
        </td>
    </tr>
</aura:iteration.
Naveen KNNaveen KN
what is the exact requirement and what is not working?
Deepali KulshresthaDeepali Kulshrestha
Hi Nehru ,

<force:inputField> is not rendering fields on UI when being used inside <aura:iteration> tag or inside nested components in Lightning application.

Please refer to this link for more information:
https://success.salesforce.com/issues_view?id=a1p3A0000008gDzQAI

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
Nehru komuNehru komu
@Naveen
im getting some list of custom object records in this attribute(Conitemlist)
i need to iterate and display the values.in that some of the filelds are lookups