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.
5

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

| improve this answer | |
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.