• Frederick H Lane
  • NEWBIE
  • 55 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 29
    Replies
In the CLI, I am getting the rror message "The "path" argument must be of type string. Received type undefined"
My path is;
C:Local Disc/Users/User/LWCSession/force-app
As I launch V.S Code, view a new Terminal session and start working on Dev org/Scartch org and component bundles, I continually receive warnings;
"Java runtime could not be located. Install it and set its location using 'codescan.ls.javaHome' variable in VS Code settings"
I have installed both Jave 8jdk and Java 12jdk in my local PC filing system, noted the mapping e.g
c:Program File (x86)/java/bin/jdk1.8.1_221/bin

Then, within the V.S Code terminal CLI, navigated to;
File>Preferences>Settings>Salesforcedx-vscode-apex>Java: Home
and in the "Edit in Settings.json" file, I mapped the Java 8 runtime location
i.e; 
{
"javascript.updateImportsOnFileMove.enabled": "always"
}
{
"salesforcedx-vscode-apex.java.home": "/Program Files (x86)/Java/jdk1.8.0_221/bin"
}

It then runs ok, but only until I log out of the current V.S Code session, then I get a runtime error again.

What am I missing?
Why sre bundles created on Lightning Web Components (with the html file included), and some are Lightning Components (within the aura framework)
What,s the difference and when to use?
When I,m following tutorials for creating Lightning Components, some lessons create projects in manifest via the CLI or Ctrl+cmd+P  SFDX: Open Project in Manifest.
What is this and why not just open a normal project?
I am trying to build my Lightning Bundles and run my instruction via ctrl+cmd+p palette but, i continually receive warnings that Java runtime needs installing and mapping. So, I installed Jav e8 onto my local P.C, and mapped it for example as; C:Programme Files (x86)
/Java/jdk1.8.0_221/bin
Then in the V.S Code filing system, I navigate File>Preferences>Settings
Then I look for the Jave folder; Salesforcedx-vscode-apex > java: Home
Then amend the .js file with;
{
"javascript.updateImportsOnFileMove.enabled": "always"
}
{
"salesforcedx-vscode-apex.java.home": "/Program Files (x86)/Java/jdk1.8.0_221/bin"
}
But is this correct? Because, then it runs, but only during this session. When I log out and log back in the V.S Code, it requires Java runrime again. See screen shots.User-added image
User-added image
 
I am doing the Trailhead module Quick Start - Salesforce DX and am on step 3 'Create and Test Our Scratch Org'.
But, have the error message 'We could not find a scratch org whose organization name is 'Dreamhouse' belonging to this Dev Hub. Make sure to create a scratch org with a definition file that sets the 'orgName' property to 'Dreamhouse'.
My Dev org playground is;
aimit.crm.academy@playful-badger-em3zf0.com
And, scratch org;
00D5E0000009bvQUAQ, username: test-16go88iapr2r@example.com

I can see the Dreamhouse App info all pulled in from Github repo  but am not sure why Trailhead can't see it. I have repeated this task twice in 2 different Playgrounds and then deleted them. No success.  Please can anyone advise?
I've created my project(LWCSessions), authorised my Dev Org, created my Scatch Org and now want to build a component HelloAimitTraineesUser-added imageUser-added image. So, I created one but, it only creates .cmp  and .auradoc  folders as per the screenshot. I notices when I created the Lightning component, taht the folder mapping automatically maps to an Aura sub-folder which is, what I suspect is causing the problem. But how do a change the mapping to, for example, LWCSessions -> force-app -> main - default -> lwc?
Also, if I simply create 2 folders for .html and .js, is that sufficient?
I have checked all the forums and there is no conclusive answer to this error on Step 10

The BoatTile component doesn't fire the plotMapMarker event when a user clicks a boat.

Here is my code;
PlotMapMarker.evt
<aura:event type="APPLICATION"
description="PlotMapMarker test">
<aura:attribute name="sObjectId"
type="String"/>
    <aura:attribute
name="lat" type="String"/>
<aura:attribute name="long" type="String"/>
<aura:attribute name="label" type="String"/>
</aura:event>

Map.cmp
<aura:component implements="flexipage:availableForAllPageTypes"
access="global" >
<aura:attribute name="width"  type="String"
default="100%" />
<aura:attribute name="height" type="String"
default="200px" />
<aura:attribute name="location"
type="SObject"/>
<aura:attribute name="jsLoaded" type="boolean"
default="false"/>
<aura:handler event="c:PlotMapMarker"
action="{!c.onPlotMapMarker}" />
<aura:registerEvent type="c:PlotMapMarker"
name="PlotMapMarker"/>
<ltng:require styles="{!$Resource.Leaflet + '/leaflet.css'}"    
scripts="{!$Resource.Leaflet + '/leaflet-src.js'}"       
afterScriptsLoaded="{!c.jsLoaded}" /> 
              <lightning:card
title="Current Boat Location" >
                  <div aura:id="map"
style="{!'width: ' + v.width + '; height: ' + v.height + ';
border:none;'}">
                      <div style="width:100%;
height:100%" class="slds-align_absolute-center">Please make a
selection</div>
                  </div>
</lightning:card>
</aura:component>

onBoatClick.cmp
({
    onBoatClick : function(component, event, helper) {
        var boat = component.get('v.boat');
        //this is how you fire an application event
        var createEvent = $A.get("e.c:PlotMapMarker");
        createEvent.setParams({'sObjectId' : boat.id});
        createEvent.fire();
    }
})

onBoatClickController.js
({
    onBoatClick : function(component, event, helper) {
        var boat = component.get('v.boat');
        //this is how you fire an application event
        var createEvent = $A.get("e.c:PlotMapMarker");
        createEvent.setParams({'sObjectId' : boat.id});
        createEvent.fire();
    }
})
        
        var boat=component.get('v.boat');
        console.log('Boat Selected Id in boattile' + boat.Id);
        var lat = boat.Geolocation_Latitude__s;
        var long = boat.Geolocation_Longitude__s;
        var label = boat.Name;
        console.log('boat name in BoatTile'+ label);
        console.log('Latitude in BoatTile' + lat);
        console.log('Longitude in BoatTile' + long);
        var PlotMapMarkerEvent = $A.get("e.c:PlotMapMarker");
         PlotMapMarkerEvent.setParams({
            "lat"   : lat,
            "long"  : long,
            "label" : label,
             "SObjectId" : boat.Id });
         PlotMapMarkerEvent.fire();
        ),


 
I have the following error message;

"We couldn't find an attribute boat of type Boat__c on the AddBoatReview component."

My code is;
BoatReviews.cmp
view sourceprint?
01BoatReviews.cmp
02 
03<aura:componentimplements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"access="global"
04                controller="BoatReviews">
05     
06     <aura:attribute name="boat" type="Boat__c" access="public"/>
07    <aura:handler name="change" value="{!v.boat}" action="{!c.refresh}"/>
08    <aura:attribute name="boatReviews" type="BoatReview__c[]" access="private"/>
09    <!-- set up the aura:method for refresh -->
10    <aura:method name="refresh" action="{!c.doInit}" access="public"
11                 description="BoatDetailsController.js invokes refresh whenever boat is updated">
12    </aura:method>
13      
14    <ui:scrollerWrapper class="scrollerSize">
15        <!--Scrollable content here -->
16        <aura:if isTrue="{!v.boatReviews.length==0}">
17            <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto"padding="around-small">  
18                <ui:outputText value="No Reviews Available" />
19            </lightning:layoutItem>
20        </aura:if>
21        <div class="slds-feed">
22            <ul class="slds-feed__list">
23                <aura:iteration items="{!v.boatReviews}" var="boatReview">
24                    <li class="slds-feed__item">
25                        <div class="slds-media__body">
26                       <div class="slds-grid slds-has-flexi-truncate">
27                            <a href="javascript:void(0)" onclick="{!c.onUserInfoClick}"
28          data-userid="{!boatReview.CreatedBy.Id}">
29          {!boatReview.CreatedBy.Name}
30      </a>
31                        &nbsp; &mdash; &nbsp; {!boatReview.CreatedBy.CompanyName}
32   </div>
33                         <p><lightning:formattedDateTime value="{!boatReview.CreatedDate}"
34                                   year="numeric" month="short" day="numeric" 
35                                   hour="2-digit" minute="2-digit" hour12="true"/></p>
36                        </div>
37                    </li>
38                </aura:iteration>
39            </ul>
40        </div>
41    </ui:scrollerWrapper>
42     
43     
44</aura:component>
 
01BoatReviewsController.js
02({
03    refresh : function(component,event,helper){
04        console.log("refresh called")
05        this.doInit;
06    },
07    doInit : function(component,event,helper){
08        console.log("BRCjs: doInit");
09        helper.onInit(component, event);
10    },
11    onUserInfoClick : function(component,event,helper){
12        var userId = event.currentTarget.getAttribute("data-userid");
13        var navEvt = $A.get("e.force:navigateToSObject");
14        navEvt.setParams({
15            "recordId" : userId,
16        });
17        navEvt.fire()
18 
19    },
20})
 
01BoatReviewsHelper.js
02({
03    onInit : function(component, event){
04                var boat = component.get("v.boat");
05                console.log("BRHjs:onInit started: boatId is " + boat.Id);
06                var action = component.get("c.getAll");
07                action.setParams({"boatId" : boat.Id});
08                console.log("boatId: " + boat.Id);
09 
10                //add the callback behavior for when the response is received
11                action.setCallback(this,function(response){
12                    var state = response.getState();
13                    if (state === "SUCCESS"){
14                        component.set("v.boatReviews", response.getReturnValue());
15                        console.log("APEX success");
16                        }
17                        else {
18                        console.log("Failed with state: " + state);
19                        }
20                });
21                //send action off to be executed in APEX
22                $A.enqueueAction(action);
23    },
24})
 
1BoatSelected.evt
2<aura:event type="APPLICATION" description="BoatSelected fired from BoatTileController's onBoatClick handler">
3    <aura:attribute name="boat" type="Boat__c"/>
4</aura:event>
 
I'm getting an error; " 
The BoatSearchResults controller must have an onBoatSelect function that stores the boatId in the component’s selectedBoatId attribute."
Here's my code;
BoatSelect.evt
<aura:event type="COMPONENT" description="fires when a user clicks a boat on BoatSearchResults.cmp">
    <aura:attribute name="BoatId" type="Id"/>
</aura:event>
BoatTile.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >

              <aura:attribute name="boat" type="Boat__c" />

    <aura:attribute name="selected" type="Boolean" default="false" />



    <aura:registerEvent name="BoatSelect" type="c:BoatSelect"/>

   

    <lightning:button name="{!v.boat.Id}" class="{!v.selected? 'tile selected' : 'tile'}"
                       onclick="{!c.onBoatClick}" >
        <div style="{! 'background-image:url(\'' + v.boat.Picture__c + '\'); '}" class="innertile">
          <div class="lower-third">
           <h1 class="slds-truncate">{!v.boat.Contact__r.Name}</h1>
          </div>
        </div>
    </lightning:button>
</aura:component>
BoatTile.css
.THIS {
}

.THIS.tile {
    position:relative;
    display: inline-block;
    width: 100%;
    height: 220px;
    padding: 1px !important;
}

.THIS .innertile {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

.THIS .lower-third {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #FFFFFF;
    background-color: rgba(0, 0, 0, .4);
    padding: 6px 8px;
}

.THIS.selected {
    border: 3px solid rgb(0, 112, 210);
}

BoatSearchResults.aspx
public with sharing class BoatSearchResults  {
    @AuraEnabled
     public static List <Boat__c> getBoats(String boatTypeId) {
      if(boatTypeId != '')  {
             return [SELECT id, BoatType__c, picture__c, name,contact__r.Name
                    FROM Boat__c
                    WHERE BoatType__c =:boatTypeId];
      } else {
          return [SELECT id, BoatType__c, picture__c, name,contact__r.Name
                    FROM Boat__c];
      }
         }
         }

BoatSearchResults.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes"
                access="global" controller="BoatSearchResults">
    <aura:handler name="init" action="{!c.doSearch}" value="{!this}"/>
    <aura:attribute name="boatTypeId" type="String" />
    <aura:attribute name="boats" type="Boat__c[]" />
    <aura:handler name="BoatSelect" event="c:BoatSelect" action="{!c.onBoatSelect}"/>
     <aura:attribute name="selectedBoatId" type="Id"/>

    <lightning:layout multipleRows="true" >

        <aura:iteration items="{!v.boats}" var="boat">
            <lightning:layoutItem  padding="around-small">
                <c:BoatTile boat="{!boat}"
                            selected="{!boat.Id == v.selectedBoatId ? 'true' : 'false' }"/>
            </lightning:layoutItem>
        </aura:iteration>

        <aura:if isTrue="{!v.boats.length==0}">
            <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">
                <ui:outputText value="No boats found" />
            </lightning:layoutItem>
        </aura:if>

    </lightning:layout>
</aura:component>

BoatTileController.js
({
    onBoatClick : function(component, event, helper) {
        var cmpEvent = component.getEvent("BoatSelect");
        var boatId = event.getSource().get("v.name");
        cmpEvent.setParams({
            "boatId" : boatId
        });
        cmpEvent.fire();
    }
})

BoatSearchResultsController.js
({
 doSearch : function(component, event, helper) {
  alert(component.get("v.boatTypeId")); //<---here I am getting undefined
        helper.onSearch(component); //calling helper method
 },
     search: function(component, event, helper){
        var params = event.getParam('arguments');
        alert(params.boatTypeId); //<---getting proper value
        alert(component.set("v.boatTypeId", params.boatTypeId)); //<---here I am getting undefined
        var a = component.get('c.doSearch');
        $A.enqueueAction(a);
    }
})

BoatSearchResultsHelper.js
({
    onSearch : function(component, event) {
        var boatTypId = component.get("v.boatTypeId");
        alert(boatTypId); //<---here I am getting undefined
        console.log("boatTypId--> " + boatTypId);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeId:boatTypId});

        //add the callback behavior for when the response is received
        action.setCallback(this, function(response){
            var state = response.getState();
            console.log("state " + state);
            if(state === "SUCCESS"){
                var res = response.getReturnValue();
                component.set("v.boats", res);
                //console.log("v.boats ->"+ JSON.stringify(res));
            }
            else{
                console.log("Failed with state: " + state);
            }
        });

        //send action off to be executed
        $A.enqueueAction(action);
    },
})
BoatSearchResultsHelper.js
({
    onSearch : function(component) {
        var action = component.get("c.getBoats");
        action.setParam({"boatTypeId":""});
        action.setCallback(this, function(response){
        var status = response.getState();
            if(status === "SUCCESS"){
             if(! $A.util.isEmpty(response.getReturnValue())){
                    component.set("v.boatTypeId",response.getReturnValue());
                } else {
                     component.set("v.recordError","No boats found");
                }
            }
        });
        $A.enqueueAction(action);
    }
})
 
I am still a little unsure what I'm doing despite passing Step 2 of the challenge.
Because, when I created my Lightning Page, only the Boat Search and BoatSearchFrom apps are visible to select. And then when I select them, I get an error message on the page as per screenshot.
The overall process I followed was;
Create or populate the FriendswithBoats.app, BoatSearchForm.cmp, BpatSearchResults.cmp, BoatSearch.cmp. Create a Lightning Page ' Friends With Boats' and drop these components in. Create a tab from the new page and finally, create a Lightning App called FriendswithBoats.app. Noting also, that the BoatSearchForm.cmp requires a dropdown menu(Boat Type), Search box and 'New' button.
But! I'm confused about the bundles which were automatically created through the unmanaged installed package. Should there not have been included; BoatSearchApp.app, BoatSearchFormApp.app and BoatSearchResultsApp.app for each of the bundles. Because, I had to create those. However, i noticed that, in the FriendswithBoats.app, the BoatSearch component is wrapped in there?

FriendswithBoats.app
<aura:application extends="force:slds" >
    <lightning:layout >
    <div class="slds-grid slds-gutters">
          <div class="slds-col slds-size_2-of-3">
            <c:BoatSearch/>
          </div>
          <div class="slds-col slds-size_1-of-3">
            <span></span>
          </div>
    </div>
      </lightning:layout>
</aura:application>

BoatSearchFormApp.app
<aura:application >
    <c.BoatSearchForm />
</aura:application>

BoatSearchResultsApp.app
<aura:application >
    <c:BoatSearchResults />
</aura:application>

BoatSearchApp.app
<aura:application >
    <c:BoatSearch />
</aura:application>

User-added image
I can't get my SOAP UI to accept the logon.
I've followed the instructions as;
You generate the wsdl for the playgorund.
Copy the username from the settings. i.e fredericklanesquash@curious-goat-486834.com
Requested a new security token from this playgorund
So, it won't accept therefore, I get no session ID

My Request1 Session URL is;  https://login.salesforce.com/services/Soap/c/43.0
My script is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>fredericklanesquash@curious-goat-486834.com</urn:username>
         <urn:password>PasswordxxxxSecurityTokenxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

Error is;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_LOGIN</faultcode>
         <faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>
         <detail>
            <sf:LoginFault xsi:type="sf:LoginFault">
               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
               <sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>
            </sf:LoginFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
I'm getting the following error;
"Challenge Not yet complete... here's what's wrong: 
Inserting a new Maintenance Request of type 'Routine Maintenance' and then closing it did not create of a new Maintenance Request based upon the original record correctly. The challenge is expecting to find the closed Maintenance Request plus an 'New' Maintenance Request of type 'Routine Maintenance' with the same Vehicle as the closed one."
I have had a look at the forum links you provided in a previous post but it's not resolving.

I have added 'Routine Maintenance' and 'Repair' in Case field Type. (Why should this be needed and this type is inconsistent with the other picklist types e.g Electrical, Structural etc)
I also include a filed 'Old Case' to store the Case ID once closed. The challenge is to automate through writing the trigger and the helkper class right? No test class is required at this stage?
Here is my code;
___________________________________________________________
trigger MaintenanceRequest on Case (before update, after update) {  
    List<case>ClosedCaseList = [SELECT Id, subject,Reason, Vehicle__c, vehicle__r.Name, equipment__c,type 
                                FROM Case WHERE Id IN :Trigger.New 
                                AND (status = 'closed' AND (type = 'Repair' OR type = 'Routine Maintenance'))];   
    Map<Id, Case>CasesToConsider = new Map<Id, Case>();
    for(Case c: ClosedCaseList){
        Boolean alreadyClosed = Trigger.oldMap.get(c.Id).Status.equals('Closed') ;
        if(!alreadyClosed)
        {
            CasesToConsider.put(c.id, c);
        }
    }
    
    List<Work_Part__c> allWorkParts = [SELECT ID, Equipment__c, Maintenance_Request__c, 
                Quantity__c, Equipment__r.Maintenance_Cycle__c FROM Work_Part__c 
                WHERE Maintenance_Request__c in: CasesToConsider.keySet()];
    
    MaintenanceRequestHelper.updateWorkOrders(CasesToConsider, allWorkParts);       
}

___________________________________________________________
public class MaintenanceRequestHelper {
    
    public static void updateWorkOrders(List<Case> maintenanceRequests){

        Set<Case> targetRequests = new Set<Case>();
        for (Case mr : maintenanceRequests)
            if (('Repair' == mr.Type || 'Routine Maintenance' == mr.Type) && 'Closed' == mr.Status)
                targetRequests.add(mr);

        List<AggregateResult> results = [
            SELECT Maintenance_Request__c, MIN(Equipment__r.Maintenance_Cycle__c)
            FROM Work_Part__c
            WHERE Maintenance_Request__c IN :targetRequests
            GROUP BY Maintenance_Request__c
        ];

        Map<Id, Integer> requestToMinCycle = new Map<Id, Integer>();
        for (AggregateResult ar : results)
            requestToMinCycle.put(
                (Id)ar.get('Maintenance_Request__c'),
                ((Double)ar.get('expr0')).intValue()
            );

        List<Case> workOrders = new List<Case>();
        for (Case t : targetRequests)
            if (('Repair' == t.Type || 'Routine Maintenance' == t.Type) && 'Closed' == t.Status)
                workOrders.add(new Case(
                    Vehicle__c=t.Vehicle__c,
                    Type='Routine Maintenance',
                    Subject=t.Subject,
                    Status='New',
                    Date_Reported__c=Date.today(),
                    Date_Due__c=Date.today().addDays(requestToMinCycle.get(t.Id))
                ));
        
        if (!workOrders.isEmpty())
            insert workOrders;
    } 
}
I need to dynamically update the server name and email address based on the Sales Reps associated with their accounts. The data is stored in 2 separate data extensions. Which tools are best for a non-dev admin to use?   AMPscript query? Personalizations Strings? Delivery Profile?
 
My error message on this challenge is; "Challenge Not yet complete... here's what's wrong: 
Could not find at least 500 Account records with the Name like 'Bulk Company'."

My steps are;
1. Import the account records and save in csv format
2. Logged into workbench and linked to my dev org
3. In REST explorer I uploaded the job
     HTTP method POST
    URI textbox:  /services/data/v41.0/jobs/ingest  (also tried API version 42)
    Request header text;
Content-Type: application/json; charset=UTF-8
Accept: application/json
    Request body text; 
{
"operation" : "insert",
"object" : "Account",
"contentType" : "CSV",
"lineEnding" : "CRLF"
}
4. Execute
5. Note the job ID
6. Add the data to the job;
 HTTP method PUT
    URI textbox:  /services/data/v41.0/jobs/ingest/7500O00000Bo5AUQAZ/batches
    Request header text;
Content-Type: text/csv
Accept: application/json
    Request body text; 
"Name" "Sample Bulk API Account 1"
"Sample Bulk API Account 2"
"Sample Bulk API Account 3"
"Sample Bulk API Account 4"
    etc until 500
7. Execute
8. Close the job
 HTTP method PATCH
    URI textbox:  /services/data/v41.0/jobs/ingest/7500O00000Bo5AUQAZ
    Request header text;
Content-Type: application/json; charset=UTF-8
Accept: application/json
Body text;
{
"state" : "UploadComplete"
}
9. Execute

Check the challenge
 



 
Customize Opportunity Stages challenge gives me "Challenge Not yet complete... here's what's wrong: 
Couldn’t find the configure fields list in prospecting tab. Please double check the instructions."
I have set up the sales process and customized the stages exactly as per the instructions and tried it also in 2 versions of the playground.
As you can see from my screenshot, the configuration fileds have been set in the Prospecting tab. What's not working?
User-added image
 
I can't complete this challenge and have checked all the forums for a solution. Can anyone help?
I've followed everything really well and even deleted everything and re-started. Only one thing I can see is that there is another user profile; 'Analytics Cloud Integration User' also sharing the rule and I cannot either delete the profile or remove it from the sharing rule. 
The steps I follwed were; 
The custom object must be named 'Project' with a resulting API name of 'Project__c'.
The Name field for 'Project' must be of type Text (not Auto-Number).
The custom object 'Project' must have a custom field of type picklist named 'Priority' with a resulting API name of 'Priority__c'.
The role label should be 'Training Coordinator' with the resulting 'Role Name' of 'Training_Coordinator'. Note that you may already have this role in your role hierarchy from a previously attempted challenge.
The sharing rule can be named anything.
The organization-wide defaults for Project cannot be set to 'Public Read/Write'.

Here is my screenshot;
User-added image
I have managed to successfully insert the .csv file for the project Get Yo Gear.
However, in challenge 1, I get an error message when I try to insert the 25 hobbies for the .csv file.
I am using the import wizzard under my personal settings but get an error which says.

I think the problem is that I have created the object Hobbies but am missing the step to allow the object to be populated with a choice of hobbies. Can anyone help?User-added image
I have managed to successfully insert the .csv file for the project Get Yo Gear.
However, in challenge 1, I get an error message when I try to insert the 25 hobbies for the .csv file.
I am using the import wizzard under my personal settings but get an error which says.

I think the problem is that I have created the object Hobbies but am missing the step to allow the object to be populated with a choice of hobbies. Can anyone help?
Superbadge error on Hobbies import
Please can someone advise the best solution to follow for this Superbadge. I'm stuck on importing cvs files using the Dataloader.io and have watched the io tutorial but haven't a clue how to match the cvs fields with SFDC none existent fields.
I'm going to have questions all the way through this.
Is there a video walk-through availabler?
Anyone can advise?
Having followed the instructions, I am still stumped with this exercise and the error merssahe;
"The 'Account Rating' permission set did not have the appropriate field-level security for the Account object"

I have created the field "Account Rating" 
Set the field accessibility to Basic Account Use
Field Level Security set to "Visible"

On the Profile, Basic Account User;
It has the Std Salesforce licence
Account Field Level Security to the Rating field is set to "Edit Access" and "Read Access"

No go. What am I doing wrong?
 
In the CLI, I am getting the rror message "The "path" argument must be of type string. Received type undefined"
My path is;
C:Local Disc/Users/User/LWCSession/force-app
I've created my project(LWCSessions), authorised my Dev Org, created my Scatch Org and now want to build a component HelloAimitTraineesUser-added imageUser-added image. So, I created one but, it only creates .cmp  and .auradoc  folders as per the screenshot. I notices when I created the Lightning component, taht the folder mapping automatically maps to an Aura sub-folder which is, what I suspect is causing the problem. But how do a change the mapping to, for example, LWCSessions -> force-app -> main - default -> lwc?
Also, if I simply create 2 folders for .html and .js, is that sufficient?
Hello ,I was trying to push lightning web component from VS Code.I am using command "SFDX: Push Source to Default Scratch Org" ,but everytime i am getting error ,sfdx force:source:push PROJECT PATH  ERROR N/A Not available for deploy for this API version. 
Any suggestion will be highly appretiated .
Thanks in Advance
I have the following error message;

"We couldn't find an attribute boat of type Boat__c on the AddBoatReview component."

My code is;
BoatReviews.cmp
view sourceprint?
01BoatReviews.cmp
02 
03<aura:componentimplements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"access="global"
04                controller="BoatReviews">
05     
06     <aura:attribute name="boat" type="Boat__c" access="public"/>
07    <aura:handler name="change" value="{!v.boat}" action="{!c.refresh}"/>
08    <aura:attribute name="boatReviews" type="BoatReview__c[]" access="private"/>
09    <!-- set up the aura:method for refresh -->
10    <aura:method name="refresh" action="{!c.doInit}" access="public"
11                 description="BoatDetailsController.js invokes refresh whenever boat is updated">
12    </aura:method>
13      
14    <ui:scrollerWrapper class="scrollerSize">
15        <!--Scrollable content here -->
16        <aura:if isTrue="{!v.boatReviews.length==0}">
17            <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto"padding="around-small">  
18                <ui:outputText value="No Reviews Available" />
19            </lightning:layoutItem>
20        </aura:if>
21        <div class="slds-feed">
22            <ul class="slds-feed__list">
23                <aura:iteration items="{!v.boatReviews}" var="boatReview">
24                    <li class="slds-feed__item">
25                        <div class="slds-media__body">
26                       <div class="slds-grid slds-has-flexi-truncate">
27                            <a href="javascript:void(0)" onclick="{!c.onUserInfoClick}"
28          data-userid="{!boatReview.CreatedBy.Id}">
29          {!boatReview.CreatedBy.Name}
30      </a>
31                        &nbsp; &mdash; &nbsp; {!boatReview.CreatedBy.CompanyName}
32   </div>
33                         <p><lightning:formattedDateTime value="{!boatReview.CreatedDate}"
34                                   year="numeric" month="short" day="numeric" 
35                                   hour="2-digit" minute="2-digit" hour12="true"/></p>
36                        </div>
37                    </li>
38                </aura:iteration>
39            </ul>
40        </div>
41    </ui:scrollerWrapper>
42     
43     
44</aura:component>
 
01BoatReviewsController.js
02({
03    refresh : function(component,event,helper){
04        console.log("refresh called")
05        this.doInit;
06    },
07    doInit : function(component,event,helper){
08        console.log("BRCjs: doInit");
09        helper.onInit(component, event);
10    },
11    onUserInfoClick : function(component,event,helper){
12        var userId = event.currentTarget.getAttribute("data-userid");
13        var navEvt = $A.get("e.force:navigateToSObject");
14        navEvt.setParams({
15            "recordId" : userId,
16        });
17        navEvt.fire()
18 
19    },
20})
 
01BoatReviewsHelper.js
02({
03    onInit : function(component, event){
04                var boat = component.get("v.boat");
05                console.log("BRHjs:onInit started: boatId is " + boat.Id);
06                var action = component.get("c.getAll");
07                action.setParams({"boatId" : boat.Id});
08                console.log("boatId: " + boat.Id);
09 
10                //add the callback behavior for when the response is received
11                action.setCallback(this,function(response){
12                    var state = response.getState();
13                    if (state === "SUCCESS"){
14                        component.set("v.boatReviews", response.getReturnValue());
15                        console.log("APEX success");
16                        }
17                        else {
18                        console.log("Failed with state: " + state);
19                        }
20                });
21                //send action off to be executed in APEX
22                $A.enqueueAction(action);
23    },
24})
 
1BoatSelected.evt
2<aura:event type="APPLICATION" description="BoatSelected fired from BoatTileController's onBoatClick handler">
3    <aura:attribute name="boat" type="Boat__c"/>
4</aura:event>
 
I'm getting an error; " 
The BoatSearchResults controller must have an onBoatSelect function that stores the boatId in the component’s selectedBoatId attribute."
Here's my code;
BoatSelect.evt
<aura:event type="COMPONENT" description="fires when a user clicks a boat on BoatSearchResults.cmp">
    <aura:attribute name="BoatId" type="Id"/>
</aura:event>
BoatTile.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >

              <aura:attribute name="boat" type="Boat__c" />

    <aura:attribute name="selected" type="Boolean" default="false" />



    <aura:registerEvent name="BoatSelect" type="c:BoatSelect"/>

   

    <lightning:button name="{!v.boat.Id}" class="{!v.selected? 'tile selected' : 'tile'}"
                       onclick="{!c.onBoatClick}" >
        <div style="{! 'background-image:url(\'' + v.boat.Picture__c + '\'); '}" class="innertile">
          <div class="lower-third">
           <h1 class="slds-truncate">{!v.boat.Contact__r.Name}</h1>
          </div>
        </div>
    </lightning:button>
</aura:component>
BoatTile.css
.THIS {
}

.THIS.tile {
    position:relative;
    display: inline-block;
    width: 100%;
    height: 220px;
    padding: 1px !important;
}

.THIS .innertile {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

.THIS .lower-third {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #FFFFFF;
    background-color: rgba(0, 0, 0, .4);
    padding: 6px 8px;
}

.THIS.selected {
    border: 3px solid rgb(0, 112, 210);
}

BoatSearchResults.aspx
public with sharing class BoatSearchResults  {
    @AuraEnabled
     public static List <Boat__c> getBoats(String boatTypeId) {
      if(boatTypeId != '')  {
             return [SELECT id, BoatType__c, picture__c, name,contact__r.Name
                    FROM Boat__c
                    WHERE BoatType__c =:boatTypeId];
      } else {
          return [SELECT id, BoatType__c, picture__c, name,contact__r.Name
                    FROM Boat__c];
      }
         }
         }

BoatSearchResults.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes"
                access="global" controller="BoatSearchResults">
    <aura:handler name="init" action="{!c.doSearch}" value="{!this}"/>
    <aura:attribute name="boatTypeId" type="String" />
    <aura:attribute name="boats" type="Boat__c[]" />
    <aura:handler name="BoatSelect" event="c:BoatSelect" action="{!c.onBoatSelect}"/>
     <aura:attribute name="selectedBoatId" type="Id"/>

    <lightning:layout multipleRows="true" >

        <aura:iteration items="{!v.boats}" var="boat">
            <lightning:layoutItem  padding="around-small">
                <c:BoatTile boat="{!boat}"
                            selected="{!boat.Id == v.selectedBoatId ? 'true' : 'false' }"/>
            </lightning:layoutItem>
        </aura:iteration>

        <aura:if isTrue="{!v.boats.length==0}">
            <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">
                <ui:outputText value="No boats found" />
            </lightning:layoutItem>
        </aura:if>

    </lightning:layout>
</aura:component>

BoatTileController.js
({
    onBoatClick : function(component, event, helper) {
        var cmpEvent = component.getEvent("BoatSelect");
        var boatId = event.getSource().get("v.name");
        cmpEvent.setParams({
            "boatId" : boatId
        });
        cmpEvent.fire();
    }
})

BoatSearchResultsController.js
({
 doSearch : function(component, event, helper) {
  alert(component.get("v.boatTypeId")); //<---here I am getting undefined
        helper.onSearch(component); //calling helper method
 },
     search: function(component, event, helper){
        var params = event.getParam('arguments');
        alert(params.boatTypeId); //<---getting proper value
        alert(component.set("v.boatTypeId", params.boatTypeId)); //<---here I am getting undefined
        var a = component.get('c.doSearch');
        $A.enqueueAction(a);
    }
})

BoatSearchResultsHelper.js
({
    onSearch : function(component, event) {
        var boatTypId = component.get("v.boatTypeId");
        alert(boatTypId); //<---here I am getting undefined
        console.log("boatTypId--> " + boatTypId);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeId:boatTypId});

        //add the callback behavior for when the response is received
        action.setCallback(this, function(response){
            var state = response.getState();
            console.log("state " + state);
            if(state === "SUCCESS"){
                var res = response.getReturnValue();
                component.set("v.boats", res);
                //console.log("v.boats ->"+ JSON.stringify(res));
            }
            else{
                console.log("Failed with state: " + state);
            }
        });

        //send action off to be executed
        $A.enqueueAction(action);
    },
})
BoatSearchResultsHelper.js
({
    onSearch : function(component) {
        var action = component.get("c.getBoats");
        action.setParam({"boatTypeId":""});
        action.setCallback(this, function(response){
        var status = response.getState();
            if(status === "SUCCESS"){
             if(! $A.util.isEmpty(response.getReturnValue())){
                    component.set("v.boatTypeId",response.getReturnValue());
                } else {
                     component.set("v.recordError","No boats found");
                }
            }
        });
        $A.enqueueAction(action);
    }
})
 
I am still a little unsure what I'm doing despite passing Step 2 of the challenge.
Because, when I created my Lightning Page, only the Boat Search and BoatSearchFrom apps are visible to select. And then when I select them, I get an error message on the page as per screenshot.
The overall process I followed was;
Create or populate the FriendswithBoats.app, BoatSearchForm.cmp, BpatSearchResults.cmp, BoatSearch.cmp. Create a Lightning Page ' Friends With Boats' and drop these components in. Create a tab from the new page and finally, create a Lightning App called FriendswithBoats.app. Noting also, that the BoatSearchForm.cmp requires a dropdown menu(Boat Type), Search box and 'New' button.
But! I'm confused about the bundles which were automatically created through the unmanaged installed package. Should there not have been included; BoatSearchApp.app, BoatSearchFormApp.app and BoatSearchResultsApp.app for each of the bundles. Because, I had to create those. However, i noticed that, in the FriendswithBoats.app, the BoatSearch component is wrapped in there?

FriendswithBoats.app
<aura:application extends="force:slds" >
    <lightning:layout >
    <div class="slds-grid slds-gutters">
          <div class="slds-col slds-size_2-of-3">
            <c:BoatSearch/>
          </div>
          <div class="slds-col slds-size_1-of-3">
            <span></span>
          </div>
    </div>
      </lightning:layout>
</aura:application>

BoatSearchFormApp.app
<aura:application >
    <c.BoatSearchForm />
</aura:application>

BoatSearchResultsApp.app
<aura:application >
    <c:BoatSearchResults />
</aura:application>

BoatSearchApp.app
<aura:application >
    <c:BoatSearch />
</aura:application>

User-added image
I can't get my SOAP UI to accept the logon.
I've followed the instructions as;
You generate the wsdl for the playgorund.
Copy the username from the settings. i.e fredericklanesquash@curious-goat-486834.com
Requested a new security token from this playgorund
So, it won't accept therefore, I get no session ID

My Request1 Session URL is;  https://login.salesforce.com/services/Soap/c/43.0
My script is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>fredericklanesquash@curious-goat-486834.com</urn:username>
         <urn:password>PasswordxxxxSecurityTokenxxxxx</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

Error is;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_LOGIN</faultcode>
         <faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>
         <detail>
            <sf:LoginFault xsi:type="sf:LoginFault">
               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
               <sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>
            </sf:LoginFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
I'm getting the following error;
"Challenge Not yet complete... here's what's wrong: 
Inserting a new Maintenance Request of type 'Routine Maintenance' and then closing it did not create of a new Maintenance Request based upon the original record correctly. The challenge is expecting to find the closed Maintenance Request plus an 'New' Maintenance Request of type 'Routine Maintenance' with the same Vehicle as the closed one."
I have had a look at the forum links you provided in a previous post but it's not resolving.

I have added 'Routine Maintenance' and 'Repair' in Case field Type. (Why should this be needed and this type is inconsistent with the other picklist types e.g Electrical, Structural etc)
I also include a filed 'Old Case' to store the Case ID once closed. The challenge is to automate through writing the trigger and the helkper class right? No test class is required at this stage?
Here is my code;
___________________________________________________________
trigger MaintenanceRequest on Case (before update, after update) {  
    List<case>ClosedCaseList = [SELECT Id, subject,Reason, Vehicle__c, vehicle__r.Name, equipment__c,type 
                                FROM Case WHERE Id IN :Trigger.New 
                                AND (status = 'closed' AND (type = 'Repair' OR type = 'Routine Maintenance'))];   
    Map<Id, Case>CasesToConsider = new Map<Id, Case>();
    for(Case c: ClosedCaseList){
        Boolean alreadyClosed = Trigger.oldMap.get(c.Id).Status.equals('Closed') ;
        if(!alreadyClosed)
        {
            CasesToConsider.put(c.id, c);
        }
    }
    
    List<Work_Part__c> allWorkParts = [SELECT ID, Equipment__c, Maintenance_Request__c, 
                Quantity__c, Equipment__r.Maintenance_Cycle__c FROM Work_Part__c 
                WHERE Maintenance_Request__c in: CasesToConsider.keySet()];
    
    MaintenanceRequestHelper.updateWorkOrders(CasesToConsider, allWorkParts);       
}

___________________________________________________________
public class MaintenanceRequestHelper {
    
    public static void updateWorkOrders(List<Case> maintenanceRequests){

        Set<Case> targetRequests = new Set<Case>();
        for (Case mr : maintenanceRequests)
            if (('Repair' == mr.Type || 'Routine Maintenance' == mr.Type) && 'Closed' == mr.Status)
                targetRequests.add(mr);

        List<AggregateResult> results = [
            SELECT Maintenance_Request__c, MIN(Equipment__r.Maintenance_Cycle__c)
            FROM Work_Part__c
            WHERE Maintenance_Request__c IN :targetRequests
            GROUP BY Maintenance_Request__c
        ];

        Map<Id, Integer> requestToMinCycle = new Map<Id, Integer>();
        for (AggregateResult ar : results)
            requestToMinCycle.put(
                (Id)ar.get('Maintenance_Request__c'),
                ((Double)ar.get('expr0')).intValue()
            );

        List<Case> workOrders = new List<Case>();
        for (Case t : targetRequests)
            if (('Repair' == t.Type || 'Routine Maintenance' == t.Type) && 'Closed' == t.Status)
                workOrders.add(new Case(
                    Vehicle__c=t.Vehicle__c,
                    Type='Routine Maintenance',
                    Subject=t.Subject,
                    Status='New',
                    Date_Reported__c=Date.today(),
                    Date_Due__c=Date.today().addDays(requestToMinCycle.get(t.Id))
                ));
        
        if (!workOrders.isEmpty())
            insert workOrders;
    } 
}
Error: Step not yet complete... here's what's wrong:
There was an issue processing your verification. Please refresh the page and try again.User-added image
I am using dev org (not any trailhead ground).
Please let me know howto fix this.

Thanks
My error message on this challenge is; "Challenge Not yet complete... here's what's wrong: 
Could not find at least 500 Account records with the Name like 'Bulk Company'."

My steps are;
1. Import the account records and save in csv format
2. Logged into workbench and linked to my dev org
3. In REST explorer I uploaded the job
     HTTP method POST
    URI textbox:  /services/data/v41.0/jobs/ingest  (also tried API version 42)
    Request header text;
Content-Type: application/json; charset=UTF-8
Accept: application/json
    Request body text; 
{
"operation" : "insert",
"object" : "Account",
"contentType" : "CSV",
"lineEnding" : "CRLF"
}
4. Execute
5. Note the job ID
6. Add the data to the job;
 HTTP method PUT
    URI textbox:  /services/data/v41.0/jobs/ingest/7500O00000Bo5AUQAZ/batches
    Request header text;
Content-Type: text/csv
Accept: application/json
    Request body text; 
"Name" "Sample Bulk API Account 1"
"Sample Bulk API Account 2"
"Sample Bulk API Account 3"
"Sample Bulk API Account 4"
    etc until 500
7. Execute
8. Close the job
 HTTP method PATCH
    URI textbox:  /services/data/v41.0/jobs/ingest/7500O00000Bo5AUQAZ
    Request header text;
Content-Type: application/json; charset=UTF-8
Accept: application/json
Body text;
{
"state" : "UploadComplete"
}
9. Execute

Check the challenge
 



 
can anyone help me solving the Second step for Lightning Component Framework Specialist super badge.. I struck in that badge.
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.

Thanks.
 
Hi,
I'm attempting the following module, where you need to install an unmanaged package.
https://trailhead.salesforce.com/modules/lightning_app_builder/units/lightning_app_builder_custom_comps 
I have followed the following help article's steps exactly
https://force.desk.com/customer/portal/articles/2710899-installing-a-package-or-app-to-complete-a-trailhead-challenge?b_id=13478

However, the unmanaged package is still being installed to my overall Salesforce instance, NOT to my "Trailhead Playground".

Given the challenge checks against the Playground, it is impossible currently to complete the challenge.
Is this a common problem & if so how do I solve it?
Thanks,
Matt