6

I am working on a lightning component where I want to show picklist field using as follows. `

<aura:component >
    <aura:attribute name="conObj" type="Contact" default="sobjectType:'Contact'}"/>
    <force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/>    
</aura:component>

`

The above code works fine in my developer org but not working on sandbox. When I try to run this by adding in an app throws some exception. Although same component works in same sandbox if I replace inputField with outputField.

Is there any solution for this ?

12
  • what error did you get here? Commented Jan 18, 2016 at 11:21
  • Are the orgs on the same version? Some orgs have begun to be upgraded to Spring 16.
    – pchittum
    Commented Jan 18, 2016 at 11:28
  • @TusharSharma : I was able to show this without apex controller in my Dev org. But it does not seems to be working in Sandbox. I am getting following error in popup while previewing this using app. "Something has gone wrong. Aura.loadComponent(): Failed to initialize application. An internal server error has occurred Error ID: 264896843-35663 (1700706397). Please try again." Whereas in console log I can see following warning message: "WARNING: Callback failed: aura://ComponentController/ACTION$getApplication" It doesn't seems to be working even with an apex controller in sandbox. Commented Jan 18, 2016 at 14:28
  • @Peter: Sandbox is on Spring 16 version. Commented Jan 18, 2016 at 14:29
  • Difference in version is important. You should escalate this to support immediately. Whenever there is a problem between GA and pre-release, support should be your first contact.
    – pchittum
    Commented Jan 18, 2016 at 15:08

1 Answer 1

1

Please try the below code.formatted syntax

You have missed curly braces for default attribute

<aura:attribute name="conObj" type="Contact" default="{ 'sobjectType' : 'Contact' }"/>
<force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/>   

You must log in to answer this question.

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