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"/>    


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 ?

  • what error did you get here? Jan 18 '16 at 11:21
  • Are the orgs on the same version? Some orgs have begun to be upgraded to Spring 16.
    – pchittum
    Jan 18 '16 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. Jan 18 '16 at 14:28
  • @Peter: Sandbox is on Spring 16 version. Jan 18 '16 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
    Jan 18 '16 at 15:08

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"/>   

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.