4

force:inputfield giving an error when i search or select the parent record

for example i have tried the below code

<aura:attribute name="contact" type="Contact" 
               default="{ 'sobjectType': 'Contact' }" access = "public"/>
<force:inputField aura:id="accountid" 
                 value="{!v.contact.AccountId}"/>

i am getting the following error in app

Something has gone wrong. Access Check Failed! AttributeSet.get(): attribute 'inContextOfRecordId' of component 'markup://c:Winter17_Test_Cmp {3:0}' is not visible to 'markup://c:Winter17_Test_Cmp {3:0}'.
.
Please try again.

2 Answers 2

5

It's caused by Lightning Component Debug mode: https://success.salesforce.com/issues_view?id=a1p3A000000eaxfQAA

0
0

I tried this and got no error. It is working perfectly fine. Even after selection there is no error in console nor on screen.

Please check below snapshot: enter image description here

To help any further please consider this complete code so that you can figure out what you were doing incorrect.

App Code:

<aura:application extends="force:slds">
    <div class="slds">
        <div class="slds-grid slds-grid--frame">
          <div class="slds-col">
                <c:LookupFieldDemo/>
          </div>
        </div>        
    </div>  
</aura:application>

Component Code:

<aura:component >
    <aura:attribute name="contact" type="Contact" 
               default="{ 'sobjectType': 'Contact' }" access = "public"/>
    <force:inputField aura:id="accountid" 
                 value="{!v.contact.AccountId}"/>

</aura:component>

Hope this helps you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .