0

I am getting the above error with this component, which is used as an action override on the Account object:

<aura:component implements="lightning:actionOverride,force:hasRecordId,flexipage:availableForRecordHome" access="global" >  
    <aura:attribute name="account" type="Account" default="{ SObjectType: 'Account' }"/>
    <force:inputField value="{!v.account.Business_Name__c}"/>
</aura:component>

The full error message is:

aura://ComponentController: org.auraframework.throwable.AuraExecutionException: ui.force.components.controllers.field.InputFieldProvider: org.auraframework.throwable.AuraRuntimeException: Error Retrieving Field for: v.account.Business_Name__c

What am I doing wrong here?!

9
  • Provide an Id for the default value or associate an account record by queryibg in apex controller. You have set sobjecttype amd input field needs a record reference
    – Rao
    Jul 19, 2017 at 0:13
  • @Rao This is supposed to be an input form for a new Account record. I just followed several online suggestions, including this SFSE post: salesforce.stackexchange.com/questions/64580/…
    – Mossi2
    Jul 19, 2017 at 0:31
  • 1
    I am guessing it is because of the default= SobjectType, lightning is case sensitive, make it default="{ sobjectType: 'Account' }"/> and see if the error resolves
    – Rao
    Jul 19, 2017 at 0:38
  • @Rao Tried it and didn't work :( Also tried putting sobjectType in quotes, just to be safe, and same thing.
    – Mossi2
    Jul 19, 2017 at 0:44
  • 1
    @Rao Hey! It was the case-sensitivity of sobjectType!! It seems my browser didn't get the updated code when I refreshed it yesterday (not sure why Chrome takes a while to clear its cache -Edge doesn't have this problem..). I created a fresh new component containing Eric's code and it worked.
    – Mossi2
    Jul 19, 2017 at 17:32

1 Answer 1

2

Your sObjectType was not the proper case (with the case you have I get the same error). Also note that it works with and without the sobjectType in the single quote, here I have it in the single quote.

This works for me when placed on the Account Lightning Page (Bundle version 40.0):

<aura:component description="myTestComponent" implements="lightning:actionOverride,force:hasRecordId,flexipage:availableForRecordHome" access="global" >
    <aura:attribute name="account" type="Account" default="{ 'sobjectType' : 'Account' }"/>
    <force:inputField value="{!v.account.CustomerPriority__c}"/>
</aura:component>

I also tested using this as an override to the new button and it worked just fine

6
  • Eric can you try a custom lookup field/ multiselect picklist?
    – Rao
    Jul 19, 2017 at 1:29
  • @Rao - MultiSelect works fine. User Lookup throws a different error when clicking in the field (Access Check Failed! AttributeSet.get(): attribute 'inContextOfRecordId' of component 'markup://c:myTestComponent {1:422;a}' is not visible) but after closing the errors the field does work, until I click a user. But that is a different issue
    – Eric
    Jul 19, 2017 at 1:34
  • Standard user lookup renders fine through force:inputfield for me, custom user lookup throws an error " "Aura.loadComponent(): Failed to initialize application. An internal server error has occurred Error ID: 887422595-11863 (-485973904)""
    – Rao
    Jul 19, 2017 at 1:42
  • 1
    @Rao - At least the inconsistencies are consistent lol
    – Eric
    Jul 19, 2017 at 1:43
  • I guessed the same about sobjectType and the OP seems to have issue with this component. I assume this is error has something to do with the type of the field.
    – Rao
    Jul 19, 2017 at 1:43

You must log in to answer this question.

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