• Rajiv Mishra
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't appear to have a Packed checkbox field in the form using a Lightning Base component.

Continue to receive this error on the Trailhead even though the packed checkbox field is there.  Here are the two relevant Lightning components.  Obviously, Trailhead is looking for a certain parameter or attribute that is missing but is not specified what exactly it is looking for.  Any help would be appreciated.
 
Camping List
<aura:component >
    <aura:handler name="addItemEvent" event="c:addItemEvent"
                  action="{!c.handleAddItem}"/>
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    <aura:attribute name="newItem" type="Camping_Item__c"
                    default="{'sobjectType' : 'Camping_Item__c',
                               'Quantity__c' : 0,
                               'Price__c' : 0}"/>
    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

        <legend id="newCampItemForm" class="slds-text-heading--small
      slds-p-vertical--medium">
            Add Camping Item
        </legend>

        <!-- CREATE NEW CAMPING ITEM FORM -->
        <form class="slds-form--stacked">

            <div class="slds-form-element slds-is-required">
                <div class="slds-form-element__control">
                    <lightning:input type="text" aura:id="itemform" label="Camping Item Name"
                                  value="{!v.newItem.Name}"
                                  required="true"/>
                </div>
            </div>

            <div class="slds-form-element slds-is-required">
                <div class="slds-form-element__control">
                    <lightning:input type="number" aura:id="itemform" label="Quantity"
                                     name="itemform"
                                     min="1"
                                     step="1"
                                     value="{!v.newItem.Quantity__c}"
                                     placeholder="0"/>

                </div>
            </div>

            <div class="slds-form-element">
                <div class="slds-form-element__control">
                    <lightning:input type="number" aura:id="itemform" label="Price"
                                      value="{!v.newItem.Price__c}"/>
                </div>
            </div>

            <div class="slds-form-element">
                <lightning:input type="checkbox" aura:id="itemform" label="Packed?"
                                  value="{!v.newItem.Packed__c}"/>
            </div>

            <div class="slds-form-element">
                <lightning:button label="Create Camping Item"
                           class="slds-button slds-button--brand"
                           onclick="{!c.clickCreateItem}"/>
            </div>

        </form>
        <!-- / CREATE NEW CAMPING ITEM FORM -->

    </fieldset>
    <!--<div class ="slds-card slds-p-top&#45;&#45;meduim">-->
        <!--<header class ="slds-card__header">-->
            <!--<h3 class = "slds-text-heading&#45;&#45;small">Items</h3>-->
        <!--</header>-->

        <!--<section class ="slds-card__body">-->
            <!--<div id="list" class = "row">-->
                <!--<aura:iteration items="{!v.items}" var="item">-->
                    <!--<c:campingListItem item="{!item}"/>-->
                <!--</aura:iteration>-->
            <!--</div>-->
        <!--</section>-->
    <!--</div>-->
    <!-- i do not think this html is needed any longer -->
    <c:campingListForm />
</aura:component>
 
Camping List Form
<aura:component >

    <aura:attribute name="newItem" type="Camping_Item__c"
                    default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Packed__c': false,
                    'Price__c': '0',
                    'Quantity__c': '0' }"/>
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>

    <div>
        <form class="slds-form--stacked">

            <div class="slds-form-element slds-is-required">
                <div class="slds-form-element__control">
                    <lightning:input type="text" aura:id="itemform" label="Camping Item Name"
                                     value="{!v.newItem.Name}"
                                     required="true"/>
                </div>
            </div>

            <div class="slds-form-element slds-is-required">
                <div class="slds-form-element__control">
                    <lightning:input type="number" aura:id="itemform" label="Quantity"
                                     name="itemform"
                                     min="1"
                                     step="1"
                                     value="{!v.newItem.Quantity__c}"
                                     placeholder="0"/>

                </div>
            </div>

            <div class="slds-form-element">
                <div class="slds-form-element__control">
                    <lightning:input type="number" aura:id="itemform" label="Price"
                                     value="{!v.newItem.Price__c}"/>
                </div>
            </div>

            <div class="slds-form-element">
                <lightning:input type="checkbox" aura:id="itemform" label="Packed?"
                                 value="{!v.newItem.Packed__c}"/>
            </div>

            <div class="slds-form-element">
                <lightning:button label="Create Camping Item"
                                  onclick="{!c.clickCreateItem}"/>
            </div>

        </form>
    </div>

</aura:component>

 
I have a list of values in one picklist field (A) and would like to have some of those values (abc, dfe) trigger to update another picklist field's (B) value (xyz) upon selection. The reason i would like to use Apex is because I have a field dependency already used for those fields and cannot overwrite it with another dependency. Any suggestion? I am new to apex and I have trouble creating the trigger.