• Amjad Khan 66
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi, 
I am trying to finish Handle Actions with Controllers section iin Lightning components trailhead. My code works as asked in the challenge.
But I still get this error:
Challenge Not yet complete... here's what's wrong: 
The campingListItem Lightning Component doesn't contain a button or its attributes are not set correctly when clicked.


<aura:component >
    <aura:attribute name='item' type='Camping_Item__c' required='true' default="{Name:'Torch', Price__c: 10, Quantity__c: 1, Packed__c: false}"></aura:attribute>
    <aura:attribute name='disabled' type='Boolean'></aura:attribute>
    
    <ui:outputText value='{!v.item.Name}'></ui:outputText>
    <ui:outputCheckbox value="{!v.item.Packed__c}"></ui:outputCheckbox>
    <ui:outputCurrency value="{!v.item.Price__c}"></ui:outputCurrency>
    <ui:outputNumber value="{!v.item.Quantity__c}"></ui:outputNumber>
    
    <ui:button press='{!c.packItem}' disabled='{!v.disabled}' label='Packed!'></ui:button>
</aura:component>

({
    packItem : function(component, event, helper) {
        var item = component.get('v.item');
        component.set('v.item.Packed__c', true);
        var btnPackItem = event.getSource();
        btnPackItem.set('v.disabled', true);
    }
})
hello,

i am a newbie to salesforce and trying to complete this trailhead challenge and unable to find a way through apex to generate this method for creating new contacts with unique id. as one requirement to pass the challenge is "The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names."

If somebody successfully completed the task kindly help me.

regards,