• Thomas H
  • NEWBIE
  • 40 Points
  • Member since 2016
  • Estate Titan Inc

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 5
    Questions
  • 20
    Replies
I am stuck here too. Suggestions ?   I have read this whole thread and the attachments. A great resource. 

The Flow seems to be functioning? The Discount Button works fine in the drop down ) 

The Lightning Page Layout is not displaying Discount Amount ? Discount Percent and Discount Percentage are fine. 

I spent wayyyy tooo much time on this Trail; but I do like the Flow functionality !        

User-added image
See attached screen capture.

Everything worked but no completion ? ... I used a new Playground.

Challenge not yet complete... here's what's wrong:
The 'harnessApp' Lightning App does not contain '<c:myFirstComponent />'.

1) First I Pre-viewed -- "I solemnly swear I know JavaScript"     no quotes 
Text display fine.

2) Then ... 
Make a change to the static text so it reads: "I am proficient in JavaScript"    no quotes 
Successful Preview ...

Thoughts ?    THX 

THXUser-added image 
Trailhead UX Prototyping -- iterating

I have some UX display funtionality issues -- seems to be making 5 iterations ?

-- I am getting error messages and get display quirks after making a bunch of small tweaks.

Myself and a few others would like to understand what final corrections need to be made in the Trail code ...
public with sharing class SearchResultsController {
     @AuraEnabled
     public static List<Account> getAccounts() {
       List<Account> accounts = [SELECT Id, Name, Phone, Website, OwnerId FROM Account LIMIT 5];
       return accounts;
     }
     @AuraEnabled
     public static List<Contact> getContacts() {
       List<Contact> contacts = [SELECT Id, Name, Phone, Email, Title FROM Contact LIMIT 5];
       return contacts;
     }
     @AuraEnabled
     public static List<Lead> getLeads() {
       List<Lead> leads = [SELECT Id, Name, Company, Email, Status, Phone FROM Lead LIMIT 5];
       return leads;
     }
   }



  

UX Prototyping -- Error message
<aura:component controller="SearchResultsController" implements="force:appHostable,
  flexipage:availableForAllPageTypes,
  flexipage:availableForRecordHome,force:hasRecordId,
  forceCommunity:availableForAllPageTypes,
  force:lightningQuickAction" access="global" >
      
    <aura:attribute name="accounts" type="Account[]"/>
    <aura:attribute name="contacts" type="Contact[]"/>
    <aura:attribute name="leads" type="Lead[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
     <div class="slds-card">
      <h2 class="slds-text-heading--medium slds-p-vertical--medium">Accounts</h2>
      <div class="slds-grid">
        <ul class="slds-col slds-size--1-of-1">
          <aura:iteration items="{!v.accounts}" var="account">
            <li class="slds-size--1-of-3 slds-show--inline-block">
     
             <lightning:card variant="narrow" iconName="standard:account" class="slds-m-around--small  slds-card_boundary">
                <aura:set attribute="title">
                  {!account.Name}
                </aura:set>
                <div class="slds-tile slds-p-horizontal--large">
                  <div class="slds-tile__detail slds-text-body--small">
                    <dl class="slds-list--horizontal slds-wrap">
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="First Label">Phone:</dt>
                      <dd class="slds-item--detail slds-truncate">{!account.Phone}</dd>
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Second Label">Website:</dt>
                      <dd class="slds-item--detail slds-truncate">{!account.Website}</dd>
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Third Label">Account Owner:</dt>
                      <dd class="slds-item--detail slds-truncate">{!account.OwnerId}</dd>
                    </dl>
                  </div>
                </div>
              </lightning:card>
            </li>
          </aura:iteration>
        </ul>
      </div>

      <h2 class="slds-text-heading--medium slds-p-vertical--medium">Contacts</h2>
      <div class="slds-grid">
        <ul class="slds-col slds-size--1-of-1">
          <aura:iteration items="{!v.contacts}" var="contact" indexVar="index">
            <li class="slds-size--1-of-3 slds-show--inline-block">
              <lightning:card variant="narrow" class="slds-m-around--small  slds-card_boundary">
                <aura:set attribute="title">
                  {!contact.Name}
                </aura:set>
                <div class="slds-tile slds-p-horizontal--large">
                  <div class="slds-tile__detail slds-text-body--small">
                    <dl class="slds-list--horizontal slds-wrap">
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="First Label">Email Address:</dt>
                      <dd class="slds-item--detail slds-truncate">{!contact.Email}</dd>
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Second Label">Title:</dt>
                      <dd class="slds-item--detail slds-truncate">{!contact.Title}</dd>
                      <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Third Label">Phone:</dt>
                      <dd class="slds-item--detail slds-truncate">{!contact.Phone}</dd>
                    </dl>
                  </div>
                </div>
              </lightning:card>
            </li>
          </aura:iteration>
        </ul>
      </div>
      <h2 class="slds-text-heading--medium slds-p-vertical--medium">Leads</h2>
      <div class="slds-grid">
        <ul class="slds-col slds-size--1-of-1"> <aura:iteration items="{!v.leads}" var="lead" indexVar="index">
          <li class="slds-size--1-of-3 slds-show--inline-block">
            <lightning:card variant="narrow" class="slds-m-around--small  slds-card_boundary">
              <aura:set attribute="title">
                {!lead.Name}
              </aura:set>
              <div class="slds-tile slds-p-horizontal--large">
                <div class="slds-tile__detail slds-text-body--small">
                  <dl class="slds-list--horizontal slds-wrap">
                    <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Second Label">Company:</dt>
                    <dd class="slds-item--detail slds-truncate">{!lead.Company}</dd>
                    <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Second Label">Email Address:</dt>
                    <dd class="slds-item--detail slds-truncate">{!lead.Email}</dd>
                    <dt class="slds-item--label slds-text-color--weak slds-truncate" title="Third Label">Status:</dt>
                    <dd class="slds-item--detail slds-truncate">{!lead.Status}</dd>
                    <dt class="slds-item--label slds-text-color--weak slds-truncate" title="First Label">Phone:</dt>
                    <dd class="slds-item--detail slds-truncate">{!lead.Phone}</dd>
                  </dl>
                </div>
              </div>
            </lightning:card>
          </li>
        </aura:iteration>
      </ul>
    </div>
  </div>
</aura:component>
 
({
    doInit : function(component, event, helper) {

        // Prepare the action to load account record
        var action = component.get("c.getAccount");
        action.setParams({"accountId": component.get("v.recordId")});

        // Configure response handler
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(component.isValid() && state === "SUCCESS") {
                component.set("v.account", response.getReturnValue());
            } else {
                console.log('Problem getting account, response state: ' + state);
            }
        });
        $A.enqueueAction(action);
    },

    handleSaveContact: function(component, event, helper) {
        if(helper.validateContactForm(component)) {
            component.set("v.hasErrors", false);

            // Prepare the action to create the new contact
            var saveContactAction = component.get("c.saveContactWithAccount");
            saveContactAction.setParams({
                "contact": component.get("v.newContact"),
                "accountId": component.get("v.recordId")
            });

            // Configure the response handler for the action
            saveContactAction.setCallback(this, function(response) {
                var state = response.getState();
                if(component.isValid() && state === "SUCCESS") {

                    // Prepare a toast UI message
                    var resultsToast = $A.get("e.force:showToast");
                    resultsToast.setParams({
                        "title": "Contact Saved",
                        "message": "The new contact was created."
                    });

                    // Update the UI: close panel, show toast, refresh account page
                    $A.get("e.force:closeQuickAction").fire();
                    resultsToast.fire();
                    $A.get("e.force:refreshView").fire();
                }
                else if (state === "ERROR") {
                    console.log('Problem saving contact, response state: ' + state);
                }
                else {
                    console.log('Unknown problem, response state: ' + state);
                }
            });

            // Send the request to create the new contact
            $A.enqueueAction(saveContactAction);
        }
        else {
            // New contact form failed validation, show a message to review errors
            component.set("v.hasErrors", true);
        }
    },

	handleCancel: function(component, event, helper) {
	    $A.get("e.force:closeQuickAction").fire();
    }
})
 
({
	validateContactForm: function(component) {
        var validContact = true;

        // First and Last Name are required
        var firstNameField = component.find("contactFirstName");
        if($A.util.isEmpty(firstNameField.get("v.value"))) {
            validContact = false;
            firstNameField.set("v.errors", [{message:"First name can't be blank"}]);
        }
        else {
            firstNameField.set("v.errors", null);
        }
        var lastNameField = component.find("contactLastName");
        if($A.util.isEmpty(lastNameField.get("v.value"))) {
            validContact = false;
            lastNameField.set("v.errors", [{message:"Last name can't be blank"}]);
        }
        else {
            lastNameField.set("v.errors", null);
        }

        // Verify we have an account to attach it to
        var account = component.get("v.account");
        if($A.util.isEmpty(account)) {
            validContact = false;
            console.log("Quick action context doesn't have a valid account.");
        }

        // TODO: (Maybe) Validate email and phone number

        return(validContact);
	}
})

The Trail is supposed to look like this ?

UX Prototyping UX Answer  -- Iterating

This is what I am supposed to be getting ....

Thanks in Advance for taking a look !

 
I have attached the following error. It appears that the Compact Layout in Contacts is correctly set as primary but this error persists ? I believe that I have the right layout appearing on my mobile as well ...
I read a different thread on this exact issue - however logging out and back in did not work.

See attached. Thanks in advance for your help !

Trailhead Error: "Challenge Not yet complete... here's what's wrong: 
Either the contact object does not have a compact layout named 'Phone and Email', or it is not set as the primary compact layout"

Compact Layout set as Primary for Contact standard object

Hi. Working through the Visualforce Mobile module, and im haivng throuble with the 3rd unit. 

Im getting this issue:
"Challenge Not yet complete... here's what's wrong: 
The 'MobileContactList' Visualforce page does not appear be displaying the contact name or contact phone."


The code I am using is:

<apex:page showHeader="true" sidebar="true" standardController="Contact" recordSetVar="contacts">
	<head>
	<apex:slds />
	</head>


	<apex:repeat value="{!contacts}" var="c">
		<dl class="slds-list_horizontal slds-wrap">
			<dt class="slds-item_label slds-text-color_weak slds-truncate" title="Contact Name:">{!c.Name}</dt>
			<dd class="slds-item_detail slds-truncate" title="Mobile Phone Number:">{!c.MobilePhone}</dd>
		</dl>
	</apex:repeat>

</apex:page>
Which then displays this;

User-added image
Which looks like it works, as long as the Contacts list view is set to view all (otherwise nothing displays).

Is this just another case of the trailhead looking for a very specific solution? I can't seem to find much help on this one.

Thanks
In the Specify Entry Criteria section, set up the criteria the record must meet to kick off this approval process.
In our example, we want Allison Wheeler to approve any accounts that she doesn’t own, so we enter these criteria on the first line.
Field: Account: Account Owner
Operator: not equal to
Value: Allison Wheeler
In the Select Approver section, assign all approval requests to Allison Wheeler.
Select Automatically assign to approver(s).

I get the error; "you must enter a value" for Allison.  What's wrong?
Select User, and, in the second field, enter Allison Wheeler.
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 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>

 
I am having trouble with what I am to do with this trailhead module.  I am at this stage and have installed lightning component quickcontact.
I am not a dev so this is hard for me.

Create a Lightning Action
To complete this challenge, you need to add a Lightning component to your org. Then use that component to create a Lightning action on the Account object. When the action’s button is clicked, it creates a new contact based on form input. To get started, install this package that contains the component bundle that you'll need to modify.
The Lightning component must be named quickContact. (Does this name need to include the capital C in contact? It is loaded as all lowercase) 
Add the appropriate interfaces to the quickContact component. (Hint: there are two.) What does this mean?  Is this referring to editing the code?
Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component.
Add the action to the Account Layout page layout.
Having trouble installing your app? Read this article for help.
Any tips would be greatly appreciated.
  • April 12, 2017
  • Like
  • 1
For this section:

User-added image

Top does not show in the picklist.  How do I add it?
I have attached the following error. It appears that the Compact Layout in Contacts is correctly set as primary but this error persists ? I believe that I have the right layout appearing on my mobile as well ...
I read a different thread on this exact issue - however logging out and back in did not work.

See attached. Thanks in advance for your help !

Trailhead Error: "Challenge Not yet complete... here's what's wrong: 
Either the contact object does not have a compact layout named 'Phone and Email', or it is not set as the primary compact layout"

Compact Layout set as Primary for Contact standard object
I'm having all sorts of problems trying to complete the challenge for the sharing rules section of this module. I feel like I have everything setup properly but still get this error message:
Challenge Not yet complete... here's what's wrong: 
The Sharing Set is not setup with proper Case access. Please check the requirements.

Sharing set name is "Share cases with customers"
Applies to Profiles: Customer Community User
Access Granted: Case - User:Account = Case:Account - Read/Write

What am I missing

 
 Make sure that the process is correct and that it is activated.
Create a process to update child record when the parent is updated.
You've been given a requirement to keep Contact addresses in sync with the Account they belong to. Use Process Builder to create a new process that updates all child Contact addresses when the address of the Account record is updated. This process:
Can have any name.
Must be activated.
Must update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.
NOTE: You may have to deactivate the validation rule for the Contacts object (created from a previous challenge) in order to complete this challenge.
I get this error on the "Add a form to the Visual Force Page.

Step Not yet complete... here's what's wrong:
The 'ContactForm' Visualforce page does not have a apex:inputField component
Note: you may run into errors if you've skipped previous steps.

However the Apex:inputField comonent is there.  Here is my code snipet.

<apex:form>
    Hello <apex:inputField value="
{!Contact.FirstName}" />
    <br /><apex:commandButton value="Submit" action="
{!save}"/>
</apex:form>
Hello Communty

I am trying to complete this challenge:

To pass this challenge, create a custom button which opens a link to 'http://google.com?q=<CONTACT NAME>' - where <CONTACT NAME> is the current contact's name. Then add this button to the default 'Contact Layout'.
The custom button must be labeled 'Google Info' with the name 'Google_Info'.
The custom button must dynamically insert the contact's name using the appropriate merge field.
The custom button must be added to the 'Contact Layout' page layout.


But keep getting this error: 

Challenge Not yet complete... here's what's wrong: 
The 'Google Info' custom button was not found. Hint: Make sure that it is a Detail Page Button (not link) and that its added to the page layout.

Please view the seenshot.

What am i doing wrong? Thanks for your help! User-added image
I keep getting: Challenge Not yet complete... here's what's wrong:
The validation rule does not reference the 'IsClosed' and 'CloseDate' fields correctly. Take a look at the requirements again.

When I test the formula it seems to work as the requirements indicate yet it does not pass the validation from trailhead. Here is the formula: AND( NOT(IsClosed) ,  CloseDate < TODAY() )
It is placed on the CloseDate field.
public class VerifyDate {
//method to handle potential checks against two dates
public static Date CheckDates(Date date1, Date date2) {
//if date2 is within the next 30 days of date1, use date2. Otherwise use the end of the month
if(DateWithin30Days(date1,date2)) {
return date2;
} else {
return SetEndOfMonthDate(date1);
}
}
//method to check if date2 is within the next 30 days of date1
private static Boolean DateWithin30Days(Date date1, Date date2) {
//check for date2 being in the past
if( date2 < date1) { return false; }
//check that date2 is within (>=) 30 days of date1
Date date30Days = date1.addDays(30); //create a date 30 days away from date1
if( date2 >= date30Days ) { return false; }
else { return true; }
}
//method to return the end of the month of a given date
private static Date SetEndOfMonthDate(Date date1) {
Integer totalDays = Date.daysInMonth(date1.year(), date1.month());
Date lastDay = Date.newInstance(date1.year(), date1.month(), totalDays);
return lastDay;
}
}

I need test class for this class.Please provide me
Hello everyone, I've been working on this challenge in the Date Security portion of Trailhead for some time but need some help (See below)

The challenge requires a profile to be created with the following traits:
    Name: Account Reviewer
    Salesforce license type
    Only read access to Account object. (And no access to any other object in the Org)

Understand that I did read the indepth reading before hand and I created a read-only clone profile in the Accounts profile list but am stuck as how to proceed from there. Challenge error states: Challenge not yet complete ... here's what's wrong: The 'Account Reviewer' profile does not work as expected. Please Advise.
I have follewed the steps listed below:
To set predefined field values:
  • Click the name of an action in the Buttons, Links, and Actions list or the Global Actions list.
  • On the action detail page, click New in the Predefined Field Values list.
  • Select the field you want to predefine a value for.
  • Specify the value for the field.
However whne I click NEW

There is no option listed to choose.
Click Save.
 
I having troube getting past this module. Could someone share their walkthrough with me?  Thanks
Project custom object records should only be seen by the owner of the record and users above the owner on the role hierarchy. However, for some Project records, the Training Coordinator must also have Read Only visibility to the Project record.

Create a custom picklist field on the Project object called “Priority” with the following values: High, Medium, and Low. Then create a criteria-based Sharing Rule for Project records where the Priority = High to share those records with the Training Coordinator role.
My Trigger is as following:-

trigger RestrictContactByName on Contact (before insert, before update)
{ //check contacts prior to insert or update for invalid data
For (Contact c : Trigger.New)
{
if(c.LastName == 'INVALIDNAME')
{ //invalidname is invalid
c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML');
}
}
}

--------------------------------------------------
And my Test class as follows:-
@isTest
private class TestRestrictContactByName
{
    @isTest static void TestContact()
    {

        Contact con=new Contact(FirstName='Arjun', LastName='Mahi');
        if(con.LastName=='INVALIDNAME')
        {
             con.AddError('The Last Name "'+con.LastName+'" is not allowed for DML');
            
        }else{insert con;}  
 
        Contact conn=new Contact(FirstName='Arjun', LastName='Kapur');
         if(conn.LastName=='INVALIDNAME')
        {
             conn.AddError('The Last Name "'+conn.LastName+'" is not allowed for DML');
            
        }else {update conn;}  
       
        Contact com=new Contact(FirstName='Rama', LastName='INVALIDNAME');
        
        if(com.LastName=='INVALIDNAME')
        {
             com.AddError('The Last Name "'+com.LastName+'" is not allowed for DML');
            
        }else {insert conn;}
    }
}


plz help me complete this Challenge :)
Thanx in Advance :)
 
I am having trouble with what I am to do with this trailhead module.  I am at this stage and have installed lightning component quickcontact.
I am not a dev so this is hard for me.

Create a Lightning Action
To complete this challenge, you need to add a Lightning component to your org. Then use that component to create a Lightning action on the Account object. When the action’s button is clicked, it creates a new contact based on form input. To get started, install this package that contains the component bundle that you'll need to modify.
The Lightning component must be named quickContact. (Does this name need to include the capital C in contact? It is loaded as all lowercase) 
Add the appropriate interfaces to the quickContact component. (Hint: there are two.) What does this mean?  Is this referring to editing the code?
Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component.
Add the action to the Account Layout page layout.
Having trouble installing your app? Read this article for help.
Any tips would be greatly appreciated.
  • April 12, 2017
  • Like
  • 1