• Dave Holford
  • 23 Points
  • Member since 2017
  • Director/Developer
  • Cloud Masons

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 4
Hi, Everyone 

Im working on this badge Lightning Data Service Basics, In the last unit i am getting an error when a check the challenge ("Challenge Not yet complete... here's what's wrong: The 'accEdit' Lightning Component does not appear to be checking if 'v.recordSaveError' is true."), i have done the code according to the trailhead, and it is working.
Any idea, what am i doing wrong?

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId"> <!--inherit recordId attribute-->

<aura:attribute name="record" type="Object" />
<aura:attribute name="accountRecord" type="Object" />
<aura:attribute name="recordSaveError" type="String" default="" />

<force:recordData aura:id="recordEditor"
    mode="EDIT" />

    <!-- Display an editing form -->
    <div class="Record Details">
        <lightning:card iconName="action:edit" title="Edit Account">
            <div class="slds-p-horizontal--small">
                <lightning:input label="Account Name" value="{!v.accountRecord.Name}"/>
                <lightning:button label="Save Account" variant="brand" onclick="{!c.handleSaveRecord}" />
 <!-- Display error message -->
    <aura:if isTrue="{!not(empty(v.recordSaveError))}">
        <div class="recordSaveError">


    handleSaveRecord: function(component, event, helper) {
        component.find("recordEditor").saveRecord($A.getCallback(function(saveResult) {
            if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {
                console.log("Save completed successfully.");
            } else if (saveResult.state === "INCOMPLETE") {
                console.log("User is offline, device doesn't support drafts.");
            } else if (saveResult.state === "ERROR") {
            var errMsg = "";
                // saveResult.error is an array of errors,
                // so collect all errors into one message
                for (var i = 0; i < saveResult.error.length; i++) {
                    errMsg += saveResult.error[i].message + "\n";
                component.set("v.recordSaveError", errMsg);

            } else {
                component.set("v.recordSaveError", "");

I am trying to complete challenge for Visualize your Business data. 

I have added the report chart as a scatter chart and the challenge is still giving me this error " The 'Property Listings' report does not appear to be using a scatter chart. 

User-added image
I'm trying to complete the Handle Record Changes and Errors module but can't seem to get past the following challenge error:
Challenge Not yet complete... here's what's wrong: 
The 'accEdit' Lightning Component JS Controller does not appear to be setting 'v.recordSaveError' with an error message.

.I've tried many different combinations of sets and am not having much luck.

I've tried several different component.set methods such as this one:
component.set('v.recordSaveError','Error: ' + saveResult.state + ', message: ' + JSON.stringify(saveResult.error));

Any ideas what this module is looking for as a valid solution?

I do see recordSaveError display after being set due to an error.