• Francis Crump
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 1
    Questions
  • 20
    Replies
Trailhead cannot recognize lightning component stated above even though its working properly.

Superbadge, Lightning web components.  Step 4.
Challenge Not yet complete... here's what's wrong:
We can't find the correct boatTypeId variable setting in the searchBoats method in the component boatSearch JavaScript file. Make sure the variable and method were created according to the requirements.
 
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class BoatSearch extends NavigationMixin(LightningElement) {
    isLoading = false;
    boatTypeId;

    // Handles loading event
    handleLoading() {
        this.isLoading = true;
    }

    // Handles done loading event
    handleDoneLoading() {
        this.isLoading = false;
    }

    // Handles search boat event
    // This custom event comes from the form
    searchBoats(event) {

        this.boatTypeId = event.detail.boatTypeId;
        this.template.querySelector('c-boat-search-results').searchBoats(this.boatTypeId);
    }
}

createNewBoat() {
    this[NavigationMixin.Navigate]({
        type: 'standard__objectPage',
        attributes: {
            objectApiName: 'Boat__c',
            actionName: 'new',
        },
    });
}
}

 

Hi everyone, looking for some assistance if possible please.

I have been doing the Lightning Web Components Superbadge and have managed to get through to Challenge 10. However, my page is not functioning quite as it should be.. The initial page loads and everything seems fine, but once I change the Boat Type selection it just keeps spinning. 

I have found some resources online and checked the answers I could find from other Trailblazers, but this has now got me quite stumped and I'd appreciate any help I could get. 

I think the problem is coming from the searchBoatResults component. I have pasted the code I have below.
 

<template>
  <lightning-tabset variant="scoped">
    <lightning-tab label="Gallery">
      <template if:true={boats.data}>
        <div class="slds-scrollable_y">
          <lightning-layout horizontal-align="center" multiple-rows>
            <template for:each={boats.data} for:item="boat">
              <lightning-layout-item
                key={boat.Id}
                padding="around-small"
                size="12"
                small-device-size="6"
                medium-device-size="4"
                large-device-size="3"
              >
                <c-boat-tile
                  boat={boat}
                  selected-boat-id={selectedBoatId}
                  onboatselect={updateSelectedTile}
                ></c-boat-tile>
              </lightning-layout-item>
            </template>
          </lightning-layout>
        </div>
      </template>
    </lightning-tab>
    <lightning-tab label="Boat Editor">
      <template if:true={boats.data}>
        <div class="slds-scrollable_y">
          <lightning-datatable
            key-field="Id"
            data={boats.data}
            columns={columns}
            onsave={handleSave}
            draft-values={draftValues}
            hide-checkbox-column
            show-row-number-column
          ></lightning-datatable>
        </div>
      </template>
    </lightning-tab>
    <lightning-tab label="Boats Near Me">
      <!-- boatsNearMe component goes here -->
      <c-boats-near-me boat-type-id={boatTypeId}></c-boats-near-me>
    </lightning-tab>
  </lightning-tabset>
</template>
import { LightningElement, api, wire } from "lwc";
import { updateRecord } from "lightning/uiRecordApi";
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { refreshApex } from "@salesforce/apex";
import { publish, MessageContext } from "lightning/messageService";
import getBoats from "@salesforce/apex/BoatDataService.getBoats";
import BOATMC from "@salesforce/messageChannel/BoatMessageChannel__c";

export default class BoatSearchResults extends LightningElement {
  isLoading = false;
  boatTypeId = "";
  boats;
  selectedBoatId;

  // Declare the columns to be used for the datatable.
  columns = [
    { label: "Name", fieldName: "Name", editable: "true" },
    {
      label: "Length",
      fieldName: "Length__c",
      type: "number",
      editable: "true"
    },
    {
      label: "Price",
      fieldName: "Price__c",
      type: "currency",
      editable: "true"
    },
    { label: "Description", fieldName: "Description__c", editable: "true" }
  ];

  // wired message context
  @wire(MessageContext)
  messageContext;

  // Get the boats using apex.
  @wire(getBoats, { boatTypeId: "$boatTypeId" })
  wiredBoats(result) {
    this.notifyLoading(false);
    this.boats = result;
    if (result.error) {
      console.log(result.error.message);
    }
    this.notifyLoading(false);
  }

  // public function that updates the existing boatTypeId property
  // uses notifyLoading
  @api
  searchBoats(boatTypeId) {
    this.notifyLoading(true);
    this.boatTypeId = boatTypeId;
  }

  // this public function must refresh the boats asynchronously
  // uses notifyLoading
  @api
  async refresh() {
    this.notifyLoading(true);

    await refreshApex(this.boats);

    this.notifyLoading(false);
  }

  // this function must update selectedBoatId and call sendMessageService
  updateSelectedTile(event) {
    this.selectedBoatId = event.detail.boatId;
    this.sendMessageService(this.selectedBoatId);
  }

  // Publishes the selected boat Id on the BoatMC.
  sendMessageService(boatId) {
    publish(this.messageContext, BOATMC, { recordId: boatId });
  }

  handleSave(event) {
    this.notifyLoading(true);

    const recordInputs = event.detail.draftValues.slice().map((draft) => {
      const fields = Object.assign({}, draft);
      return { fields };
    });

    // For each record.
    const promises = recordInputs.map((recordInput) => {
      updateRecord(recordInput); // Updates the record.
    });
    Promise.all(promises)
      .then(() => {
        this.dispatchEvent(
          new ShowToastEvent({
            title: "Success",
            message: "Ship It!",
            variant: "success"
          })
        );
        return this.refresh();
      })
      .catch((error) => {
        this.dispatchEvent(
          new ShowToastEvent({
            title: "Error",
            message: error.message,
            variant: "error"
          })
        );
        this.notifyLoading(false);
      })
      .finally(() => {
        this.draftValues = [];
      });
  }

  // Check the current value of isLoading before dispatching the doneloading or loading custom event
  notifyLoading(isLoading) {
    this.isLoading = isLoading;
    if (this.isLoading) {
      this.dispatchEvent(new CustomEvent("loading"));
    } else {
      this.dispatchEvent(new CustomEvent("doneloading"));
    }
  }
}

 

I am stuck on the https://trailhead.salesforce.com/modules/security-for-lightning-components/units/secure-your-lightning-java-script-code challenge.
After searching on the internet, I am unable to find a solution.  I found a link https://developer.salesforce.com/forums/?id=9060G000000UbhwQAC but I am not sure what solution in it works.  (And I found another web page referring this same url saying "Jeff" had found a solution..but it did not work for me.  Here is what Jeff first says:
Trying securing the description instead:   secureFilters.html(results[i].Description__c)

I tried that and get this message:  
Challenge Not yet complete... here's what's wrong: 
The 'LTNG_SecureFilters_Challenge' component does not appear to be requiring the secureFilters resource.

Further in the post the person who asked the question says this:   "That worked. Thanks."
And then he summarizes and says would this be OK:

​secureFilters.html(results)  

And Jeff replies, "Correct".  

So I tried doing this:  
                var results =   response.getReturnValue()  ;
                secureFilters.html(results) ;    
And this created an error.....
And I tried this (thinking that maybe it needs to be passed to a variable) :
                var results =   response.getReturnValue()  ;
                results =  secureFilters.html(results) ;
And this created an error.....

Can anyone please help?

Thank you,
Stuart

I can't pass this challenge Process Design Without Limits Learn About Object Design-Time Limits. I have below error message. Can anypne please help.

Challenge Not yet complete... here's what's wrong: 
Changing the owner of the Account record failed to update the 'Account_Owner_Name_Process__c' field for the Case object . Make sure that the process is correct and that it is activated.https://trailhead.salesforce.com/modules/process-design-without-limits/units/process-design-without-limits-object
Challenge Not yet complete... here's what's wrong:  Changing the owner of the Account record failed to update the 'Account_Owner_Name_Process__c' field for the Case object . Make sure that the process is correct and that it is activated.

I've implemented the Process Builder on Account to update the Case.Account_Owner_Name_Process__c field if Account.OwnerId changes.
The name is correct 'Update Case Account Owner' ( API Name: Update_Case_Account_Owner) and it's active.

My process builder:
Process Builder is Active

Object - Account - fire on changes

Owner is Changed Entry Criteria

Update Related Cases immediate Action
 
I need help with Process Automation Superbadge Challenge # 5.
I cannot get through this challenge. I am keep getting error messages. When I activate the process It gives me following error
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. 
First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You Need Approval From Manager.: []


Validation Rule: for high value opportunities. 
Amount  > 100000( this is my validation rule)


I also try this validation rule as well but got the different error:
AND( 
IsClosed = TRUE, 
Amount > 100000, 
Approved__c <> TRUE 
)

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3011N000000EJ8H. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []

When I Deactivate the process:
I got this error
Challenge Not yet complete... here's what's wrong: 
A new Opportunity with a 'Prospecting' stage for a 'Prospect' Account did not successfully create a Task for the Account owner with the Subject 'Send Marketing Materials'.

This doesnt make any sense to me because in my ORG I was able to verify the challenge. It did created the Robot Setup Record an also created the Task for the Opprotunity Owner.
Also I am getting this error message i my email
Error element myRule_9_A1 (FlowActionCall).
This approval request requires the next approver to be determined by the Manager field. This value is empty. Please contact your administrator for more information. 
What I am getting this error messages there is something wrong with the Approval Process or the Validation Rule. But I dnt know how to fix this.
One thing I have noticed that When the Opportunity is created with the Stage Negotiation it give me following error in my org.
This is when the Opp stage is Negotiation.
User-added image

User-added image

Here is my Approval Process:
User-added image

User-added image

User-added image

 


 

Hello everyone, I am working one the Module Build Reusable Lightning Components in the Unit Create an Indicator Badge Apex Service, I did all the steps but when I tried to verify this step I get an error: "Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.ListException: List index out of bounds: 0"

Since it is only two Copy / Paste the chanllange of this unit, can someone help me with this ?

Hi Can some one explain me how to use two components with Lightning Data Service, i tried the following code for accDisplay and accEdit.
This worked as i expected but i got the following error!

I am missing some thing, can some one explain me how LDS works with multiple componets!
 
Challenge Not yet complete... here's what's wrong: 
The 'accDisplay' Lightning Component does not appear to be displaying the 'Name' using 'ui:outputText' and the value 'v.accountRecord.Name
 
<!--accDisplay component-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
 <aura:attribute name="accountRecord" type="Object" />
<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="VIEW"
    />
   



    <!-- Display a header with details about the record -->
    <div class="slds-form--stacked">
        <div class="slds-form-element">
            <label class="slds-form-element__label" for="recordName">Name: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordName"
                value="{!v.simpleNewAccount.Name}" />
            </div>
            <label class="slds-form-element__label" for="recordIndustry">Industry: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordIndustry"
                value="{!v.simpleNewAccount.Industry}" />
            </div>
             <label class="slds-form-element__label" for="recordDescription">Description: </label>
            <div class="slds-form-element__control">
              <ui:outputTextArea class="slds-input" aura:id="recordDescription"
                value="{!v.simpleNewAccount.Description}" />
            </div>
             <label class="slds-form-element__label" for="recordPhone">Phone: </label>
            <div class="slds-form-element__control">
              <ui:outputPhone class="slds-input" aura:id="recordPhone"
                value="{!v.simpleNewAccount.Phone}" />
            </div>
        </div>
    </div>

   

   
</aura:component>
<!--accEdit-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">

<aura:attribute name="accountRecord" type="Object"/>
<aura:attribute name="simpleNewAccount" type="Object"/>
<aura:attribute name="newContactError" type="String"/>

<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="EDIT"
    />
   
    <ui:outputText class="slds-output" 
                value="Edit Account" />
     <lightning:input aura:id="recordName" name="accountRecord" label="Name"
                  value="{!v.simpleNewAccount.Name}" />

     <lightning:button label="Save Account" onclick="{!c.handleSaveRecord}"
               variant="brand" class="slds-m-top--medium"/>
</aura:component>

 
Hi All,

On 5/26/2017 I had created an email service within a new sandbox to test an email handler - everything was working just fine on that date. Then on 5/29/2017 I was no longer able to email the sandbox, receiving this error:

dhtest2@7g5j57uejkh4vt0bibcq1xco2hws8etoi9fuw21zizsshsahg.s-3l1wvmak.cs1.apex.sandbox.salesforce.com (dhtest2@7g5j57uejkh4vt0bibcq1xco2hws8etoi9fuw21zizsshsahg.s-3l1wvmak.cs1.apex.sandbox.salesforce.com)
Your message couldn't be delivered. The Domain Name System (DNS) reported that the recipient's domain does not exist.
Contact the recipient by some other means (by phone, for example) and ask them to tell their email admin that it appears that their domain isn't properly registered at their domain registrar. Give them the error details shown below. It's likely that the recipient's email admin is the only one who can fix this problem.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Diagnostic information for administrators:
Generating server: BY2PR11MB0613.namprd11.prod.outlook.com
dhtest2@7g5j57uejkh4vt0bibcq1xco2hws8etoi9fuw21zizsshsahg.s-3l1wvmak.cs1.apex.sandbox.salesforce.com
Remote Server returned '550 5.4.310 DNS domain does not exist [Message=InfoDomainNonexistent] [LastAttemptedServerName=7g5j57uejkh4vt0bibcq1xco2hws8etoi9fuw21zizsshsahg.s-3l1wvmak.cs1.apex.sandbox.salesforce.com] [CO1NAM03FT010.eop-NAM03.prod.protection.outlook.com]'

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Could this be at all related to our internal network? We didn't change antyhing..  Or does this seem like a Salesforce issue? I am surprised that within 3 days it worked and then stopped working.  Anyone have any idea or perhaps has experienced this problem before in their instance?

I reached out to support but was told that email services are a developer issue, not something support can offer assistance with (even though it's a standard functionality).  Last bit of info - no matter what I use for the apex class associated with the email service, i cannot send any emails into the sandbox.  All Email is also enabled within the sandbox.





 
Hi, I am checking a challenge step and am being told (incorrectly, I think) that my org is not configured properly. it keeps saying:

Challenge Not yet complete... here's what's wrong: 
Variable 'AccountRevenue' isn't properly configured. Check the instructions

I have checked an rechecked.... how do get  past this?.
My code is given below. It displays error to me:
Error: Compile Error: Method does not exist or incorrect signature: [Schema.DescribeFieldResult].isCreatable() at line 44 column 25
 
public with sharing class CRUD_FLS_Create_Challenge{

    public Id newUser {get;set;}
    
    public List<Personnel__c> getUnReg() {
        unregisteredUsers = new List<Personnel__c>();
       List<Jouster__c> currentParticipants = [ select Participant_Name__r.Name from Jouster__c ];
       List<Personnel__c> currentPersonnel = [ select Id, Name, Favorite_Color__c, Castle__r.Name from Personnel__c limit 15];
       Boolean reg;
       
       System.debug(currentParticipants);
       System.debug(currentPersonnel);
       
       for( Personnel__c p : currentPersonnel)
       {
           reg = false;
           for(Jouster__c j : currentParticipants)
           {
               if(j.Participant_Name__r.Name == p.Name) {
                   reg = true;
                   break;
               }
           }
           
           if(reg == false)
               unregisteredUsers.add(p);
       }
       
       System.debug(unregisteredUsers);
       
       return unregisteredUsers;
    }

    public Jouster__c newParticipant {get;set;}
    public List<Personnel__c> unregisteredUsers;
    
    
    public void register(){
        System.debug(newUser);
        Personnel__c p = [select Name, Favorite_Color__c, Castle__r.Name from Personnel__c where Id =: newUser]; 
        if (!Schema.sObjectType.Jouster__c.fields.Participant_Name__c.isCreatable()) {
            if (!Schema.sObjectType.Jouster__c.fields.Color__c.isCreatable()) {
                if(!Schema.sObjectType.Jouster__c.fields.Favorite_Color__c.isCreatable()) {  
                    if(!Schema.sObjectType.Jouster__c.fields.Castle__c.isCreatable()) {   
                        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Error: Insufficient Access'));                 
                    }
                }
            }  
        }
        if([select id from Jouster__c where Participant_Name__r.Name =: p.Name] != null)
            insert new Jouster__c(Participant_Name__c=newUser, Color__c=p.Favorite_Color__c, Castle__c=p.Castle__c);
        else
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Error: Jouster already entered in Tournament'));
    }    
    public string[] getPermSets(){
        String[] permSetArray = new List<string>();
        PermSetArray.add('User with Read ONLY Access to the Jousters object'); // description of the needed permission set
        return permSetArray;
    }

}

 
Hello Everyone,

I have created visualforce email template and tagged to approval process which will get trigger to Approver when some one request for approval.
 
When Approver tries to approve/reject through the email he/she received, approval response is not changing accordingly in salesforce.

Can some one please suggest what might be the problem here. Is the problem with visualforce template or any ?

Thanks in advance!!!

 
Hi All,

I receive the following error when attempting to check the challenge for Apply Unit of Work

Challenge Not yet complete... here's what's wrong: 
The 'challangeComplete' method in the 'UnitOfWorkTest' class has not successfully passed all tests. Ensure that you run the tests and it passes successfully before attempting this challenge again.

However, when I run my code in Developer Console, my test passes.  Any ideas on the problem?  Here is the code:

@isTest
public class UnitOfWorkTest {
    @isTest static void challengeComplete(){
        fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(
            new Schema.SObjectType[]{
                Account.SObjectType,
                Contact.SObjectType,
                Note.SObjectType
            }
        );
        
        for (Integer i=0 ; i<100 ; i++) {
            Account a = new Account(Name= 'Test' + i);
            uow.registerNew(a);
            
            for (Integer j=0 ; j<5 ; j++) {
                Contact c = new Contact(LastName = 'Test'+i + ' ' +j);
                uow.registerNew(c, Contact.AccountId, a);
                
                Note n = new Note(Body='Test '+i + '' + j, Title='Test'+i+j);
                uow.registerRelationship(n, Note.ParentId, a);
                uow.registerNew(n, Note.ParentId, a);
            }
        }

        uow.commitWork();
 
        fflib_SObjectUnitOfWork uow2 = new fflib_SObjectUnitOfWork(
            new Schema.SObjectType[]{
                Account.SObjectType,
                Contact.SObjectType,
                Note.SObjectType
            }
        );        
        for (Account a : [SELECT Id, Name, (SELECT Id, LastName FROM Contacts), (SELECT Id, ParentId, Title, Body FROM Notes) FROM Account]) {
            a.Name = 'Test';
            uow2.registerDirty(a);
            
            Integer i = 0;
            for (Contact c : a.Contacts) {
                c.LastName = 'Test';
                uow2.registerDirty(c);
                
                a.Notes[i].Body='Test';
                uow2.registerDirty(a.Notes[i]);
                i++;
            }
        }        
        
        test.startTest();
        uow2.commitWork();
        test.stopTest();
        
        System.assertEquals(100, [Select Id from Account].size());
        System.assertEquals(500, [Select Id from Contact].size());
        System.assertEquals(500, [Select Id from Note].size());
    }
}
trigger should work for after insert , after update, after delete, after undelete 
 Thanks  in advance
Has anyone completed this trail? I am stomped on challenge number 3, regarding created the process for fulfillment. Any pointers or guidance would be appreciated.
 
Hi everyone!
I have a problem with the challenge, my App work fine but I don´t pass the challenge. This is my code:

campingList.cmp:
 
<aura:component controller="CampingListController">
    
    <ltng:require styles="/resource/SLDS105/assets/styles/salesforce-lightning-design-system-ltng.css"/>

	<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
     <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Price__c': 0,
                    'Quantity__c': 0}"/>
    
    <div class="slds-card slds-p-top--medium">
    <ui:inputText aura:id="campname" label="Camping Name"
        value="{!v.newItem.Name}" required="true"/>
    <ui:inputCheckbox aura:id="packed" label="Packed?"
        value="{!v.newItem.Packed__c}"/>
     <ui:inputCurrency aura:id="price" label="Price"
        value="{!v.newItem.Price__c}" required="true"/>
     <ui:inputNumber aura:id="quantity" label="Quantity"
        value="{!v.newItem.Quantity__c}" required="true"/>
    
    <ui:button label="Create Camping" press="{!c.clickCreateCamping}"/>
    </div>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>	 
    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Campings</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>
</aura:component>

campingListController.js:
 
({
    
    // Load expenses from Salesforce
	doInit: function(component, event, helper) {

    // Create the action
    var action = component.get("c.getItems");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            component.set("v.items", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
	},
    
    clickCreateCamping: function(component, event, helper) {
        
        if(helper.validateCampingForm(component)){
	        // Create the new expense
	        var newCamping = component.get("v.newItem");
	        helper.createItem(component, newCamping);
	    }
    }
})
campingListHelper.js
 
({
    
    createItem: function(component, camping) {
        
        var action = component.get("c.saveItem");
        action.setParams({
            "item": camping
        });
    	action.setCallback(this, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var campings = component.get("v.items");
            campings.push(response.getReturnValue());
            component.set("v.items", campings);
        }
    	});
    	$A.enqueueAction(action);
    },
    
    validateCampingForm: function(component) {
      
     	var validQuantity = true;
        var validPrice = true;

        var nameField = component.find("campname");
        var campname = nameField.get("v.value");
        
        var quantityField = component.find("quantity");
        var quantity = quantityField.get("v.value");
        
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        
        if ($A.util.isEmpty(campname) || $A.util.isEmpty(quantity) || $A.util.isEmpty(price)){
            validQuantity = false;
            validPrice = false;
            nameField.set("v.errors", [{message:"Camping name, quantity or price can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
		
		return(validQuantity && validPrice);        
	}
})
CampingListController.apxc:
 
public with sharing class CampingListController {

    @AuraEnabled
    public static List<Camping_Item__c> getItems() {
    
        // Check to make sure all fields are accessible to this user
        String[] fieldsToCheck = new String[] {
            'Id', 'Name', 'Packed__c', 'Price__c', 'Quantity__c'
        };
        
        Map<String,Schema.SObjectField> fieldDescribeTokens = 
            Schema.SObjectType.Camping_Item__c.fields.getMap();
        
        for(String field : fieldsToCheck) {
            if( ! fieldDescribeTokens.get(field).getDescribe().isAccessible()) {
                throw new System.NoAccessException();
                return null;
            }
        }        
        
        // Perform isAccessible() checking first, then
        return [SELECT Id, Name, Packed__c, Price__c, Quantity__c 
                FROM Camping_Item__c];
    }
    
    @AuraEnabled
    public static Camping_Item__c saveItem(Camping_Item__c item) {
        // Perform isUpdatable() checking first, then
        upsert item;
        return item;
    }
}
I am still getting this error:

Challenge Not yet complete... here's what's wrong:
The campingList JavaScript helper isn't saving the new record to the database or adding it to the 'items' value provider.


My App save the new record into the database and add it to the "items" list.
Thanks for your answers!




 
Challenge - Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
The component requires an attribute named items with the type of an array of camping item custom objects.
The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
If the form is valid, the JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c.


My answer - 
<aura:component >
<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}"/>
 <p>Name:
        <ui:inputText value="{!v.newitem.name}"/>
    </p>    
  <p>Packed:
        <ui:inputCheckbox value="{!v.newitem.Packed__c}"/>
     
    </p>    
  <p>Price:
        <ui:inputCurrency value="{!v.newitem.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:inputNumber value="{!v.newitem.Quantity__c}"/>
    </p>
</aura:component>


Error -

Challenge Not yet complete... here's what's wrong: 
The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.

Please share the correct solution.
Challenge says "To pass this challenge, block all users' access to the Salesforce1 for iOS app or the Salesforce1 for Android app."

"Instructions say: From Setup, enter Connected Apps in the Quick Find box, then select Connected Apps OAuth Usage.
Click Block on the row for Salesforce1 for Android or Salesforce1 for iOS.
When you’re ready to reenable access to the app, click Unblock."

However, neither Salesforce1 for Android nor Salesforce1 for iOS appear in the list "Connected Apps OAuth Usage".  I do see this above "Connected apps that are installed but haven’t been used by anyone don’t appear in the list." So I tried to use the newly downloaded Salesforce1 app in my hands-on org but ... well, I can't. It won't let me log on without authorization token, which - as a Salesforce employee - is aligned to my Salsforce email, not my hands-on org email address. So ... I can't complete the challenge. Help?
Please help me resolve this challenge:

https://trailhead.salesforce.com/modules/apex_integration_services/units/apex_integration_soap_callouts

The Challenge is as follows:

Generate an Apex class using WSDL2Apex and write a test class.
Generate an Apex class using WSDL2Apex for a SOAP web service, write unit tests that achieve 100% code coverage for the class using a mock response, and run your Apex tests.

Use WSDL2Apex to generate a class called 'ParkService' in public scope using this WSDL file. After you click the 'Parse WSDL' button don't forget to change the name of the Apex Class Name from 'parksServices' to 'ParkService'.
Create a class called 'ParkLocator' that has a 'country' method that uses the 'ParkService' class and returns an array of available park names for a particular country passed to the web service. Possible country names that can be passed to the web service include Germany, India, Japan and United States.
Create a test class named ParkLocatorTest that uses a mock class called ParkServiceMock to mock the callout response.
The unit tests must cover all lines of code included in the ParkLocator class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.

The error I receive when checking the challencge is:

Challenge Not yet complete... here's what's wrong:
Executing the 'country' method on 'ParkLocator' failed. Make sure the method exists with the name 'country', is public and static, accepts a String and returns an array of Strings from the web service.

Here is the code I am using:
public class ParkLocator {
    public static String[] country(String ctry) {
        ParkService.ParksImplPort prk = 
            new ParkService.ParksImplPort();
        return prk.byCountry(ctry);
    }
}

and
 
@isTest
global class ParkServiceMock implements WebServiceMock {
   global void doInvoke(
           Object stub,
           Object request,
           Map<String, Object> response,
           String endpoint,
           String soapAction,
           String requestName,
           String responseNS,
           String responseName,
           String responseType) {
        // start - specify the response you want to send
        ParkService.byCountryResponse response_x = 
            new ParkService.byCountryResponse();
            
        List<String> myStrings = new List<String> {'Park1','Park2','Park3'};
    
        response_x.return_x = myStrings;
        // end
        response.put('response_x', response_x); 
   }
}

and
 
@isTest
private class ParkLocatorTest  {
    @isTest static void testCallout() {              
        // This causes a fake response to be generated
        Test.setMock(WebServiceMock.class, new ParkServiceMock());
        // Call the method that invokes a callout
        List<String> result = new List<String>();
        List<String> expectedvalue = new List<String>{'Park1','Park2','Park3'};
        
        result = ParkLocator.country('India');
        // Verify that a fake result is returned
        System.assertEquals(expectedvalue, result); 
    }
}

Any help which can be provided is greatly appreciated.  If you could advise me at raadams173@gmail.com if you reply with a solution, I can log in to check it.

Thanks.

Ryan
Hello All,
I have completed this challenge.

1-For this first you need to create a helper formula field(type-percent) 
Percent Completed :
(DATEVALUE( CreatedDate ) - CloseDate )/100


2- Then you need to create the actual formula field (type- text) by using the helper formula field.
Opportunity Progress :

IF( Percent_Completed__c <=25,"Early", 
IF(Percent_Completed__c <=75,"Middle", 
"Late"))

Thanks,
Nida