+ Start a Discussion
Qiuyan LIUQiuyan LIU 

force:inputField doesn't work

Hello, I am trying to use "force:inputField" to create type-specific input component implementation based on the data type to Create Account Record. 

Here is what I did : 

In cmp file : 

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="account" type="Account" default="{ sobjectType: 'Account' }"/>
 <force:inputField value="{!v.account.Name}" />

In Controller :
doInit: function(component, evt, helper) {
         var action = component.get("c.getAccount");
        action.setCallback(this, function(a) {
                component.set("v.account", a.getReturnValue());

I can see the v.account value if I use ui:inputText, so it is not the problem of javascript or apex code. I did not got any error,  only a blank page with nothing in html markup, the javascript function is not event executed. 

Please help me ! Thanks a lot 
I'm having the same issue too. I look forward to hearing a solution!
Is it possible that you are viewing this component within a VF Page in SFDC Classic?  I don't believe you can use force:inputField at all within classic if I'm not mistaken..  Unfortunately. there is no ui:inputField.. hmmm .waiting SFDC..  you're forced to roll your own solution.
<force:inputField> is not working for me either, both in a lightning UI page and in a harness app.
I just finished a multi-month marathon with Salesforce R&D on the issue of <force:inputField> components not working. Here is the solution/workaround we achieved: