• Erica Gladue
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Specialist
  • Columbus State Community College

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am trying to get a completed list of when I completed each badge. Please help!
Thanks,
Erica
I am trying to get a completed list of when I completed each badge. Please help!
Thanks,
Erica
I've tried logging into Trailhead and it will allow me to log in but it won't let me undertake any challenges it keeps saying log into developer edition.  When I try to sign up again it says that I'm already logged in.  Please can someone tell me how to log into the developer edition.  Thank you.
 
Hi, 

I am trying to create a from dynamically from a field set, to do so I am using the apexcontroller method to create a json string for schema.FieldSetmember and using that to create a new component using $A.createComponent which is working for ui markups of type ui:inputText and ui:inputEmail etc... but not with force:inputField


Test.cmp

<aura:component controller="FormController">
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
   <!-- <aura:attribute name="contact" type="Contact"   default="{ 'sobjectType': 'Contact'}"/> -->
    <form aura:id="form">
        
    
        {!v.body} 
        
    </form>

</aura:component>


TestController.js


    doInit : function(cmp,event) {
    
      //  helper.creatFormElements(cmp);
      //  
       var action = cmp.get("c.getFieldSet");
        
       action.setParams({
            
            "ObjectName": "Contact",
            "FieldSetName" : "New_Contact"
            
        });
        
        action.setCallback(this,function(results){
         
            var fields = JSON.parse(results.getReturnValue());
            
            console.log('label'+fields[0].isRequired);
            console.log('label'+fields[0].fieldLabel);
          
          

            $A.createComponents([
            ["aura:attribute",
            {
                "name":"contact", 
                "type":"Contact",
                "default":"{ 'sobjectType': 'Contact'}"
            }],
            ["ui:inputText",
            {
                "class":"form-control", 
                "aura:id":fields[0].fieldLabel+0,
                "value" : fields[0].fieldLabel
            }],
            ["force:inputField", /* if i replace this with ui:inputfield it works fine */
            {
                "class":"form-control", 
                "aura:id":fields[1].fieldLabel+1,
                "value" : "{!v.contact.lastName}"
            }]
            ],
            function(inputText){
                console.log(inputText);
                //Add the new button to the body array
                if (cmp.isValid()) {
                    console.log('cmp is valid');
                    var body = cmp.get("v.body");
                    body.push(inputText[0]);
                    body.push(inputText[1]);
                     body.push(inputText[2]);
                    cmp.set("v.body", body);
                }
            }
        );
            
        });
        
        $A.enqueueAction(action);
    },


Please let me know if there is a easy way to use FieldSets in Lightning components. 
  • November 23, 2015
  • Like
  • 2