• Andrew Eversley
  • NEWBIE
  • 335 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 58
    Replies
The challenge is to search for the inserted record with an inline SOSL search, using Execute Anonymous.

This is what I did using Execute Anonymous Window
 
List<List<sObject>> searchList = [FIND 'Mission Control' IN ALL FIELDS 
                                  RETURNING Contact(FirstName, LastName,
                                  Phone, Email, Description)];
Contact[] searchContacts = (Contact[])searchList[0];
System.debug('Found the following contacts:');
for (Contact c : searchContacts) {
   System.debug('"'+c.LastName + ', ' + c.FirstName+'"');
}

But still there's an error when I check the challenge.

Challenge Not yet complete... here's what's wrong: 
Could not find the contact's name in the debug log. Be sure to run a query for your record, and to write your contact's name to the debug log using the System.debug() method.
I'm stuck on the Modify the NewURLPolicyCondition Apex Class challenge: Modify the NewURLPolicyCondition Apex class you created in an earlier challenge and change its condition from any time in the past two days to the past week.

I completed the previous challenges in this section with ease but don't see any reference to "in the past two days" so I am not sure how to modify the condition "to the past week". 

Please help!
 
Hello Community,

I'm having an issue with this particular challenge below: 

Write an Apex trigger that fires before records are inserted and ensures that the ShippingState field has the same value as the BillingState field.
Create an Apex class named AccountTriggerHandler that contains a public static method called CreateAccounts to accept the List of Account objects.
For each Account record, before saving, ensure that the ShippingState field has the same value as the BillingState field.
Write an Apex trigger named AccountTrigger that fires before records are inserted.
The Apex trigger must call the AccountTriggerHandler.CreateAccounts() method with the collection of new records.
Create a test class named AccountTriggerTest that inserts 200 Account records with a BillingState of CA. After the insert, test to ensure that all 200 records have a ShippingState of CA.
Before verifying this challenge, run your test class at least once using the Developer Console Run All feature.

This is my Challenge Error:

Challenge Not yet complete... here's what's wrong: 
The Trigger 'AccountTrigger' does not appear to be calling the AccountTriggerHandler class correctly or using isBefore or isInsert content variables.

These are my codings below :
AccountTriggerHandler
User-added image

AccountTrigger - Trigger On Account Object
User-added image

AccountTriggerTest
User-added image

P.S. I'm pretty new to the developing with Apex so I'm learning and growing so the help is appreciated community. 
I am having issues with Creating  an Apex class that returns Account objects for the Mapping.net concepts challenge.  I am a VB and Javascript programmer and I can't seem to get the syntax right.   
public class AccountUtils {
    
    public static void accountsByState(String st){
       List<String> accts = [SELECT Id, Name FROM Account WHERE billingState = :st];
 }
  
}
I believe the first part is correct, but I cannot seem to get a return value.  I am confused by the constructors.  I have tried the documentation but I can't get a return value.  Please help.  I need to get this challenge complete.
 
Hello Community, 
I'm currently working on the "Build an Account Geolocation App" project in the Trailhead Project section. I'm having an issue on "Step 2: Use the AccountLocator Component in a Lightning Application"

My issue is this:

The Steps:
1.In the Developer Console, select File > New > Lightning Application.
2.Specify AccountLocatorApp as the bundle name, and click Submit.
3.On the AccountLocatorApp.cmp tab, implement the application as follows:


After I go to step 2 and submit the AccountLocatorApp name it gives me an error stating:

"duplicate value found: <unknown> duplicates value on record with id: <unknown>"

Then this error:
Operation did not complete "Long running operation did not complete, continuing in background"

I would like some assistance or insight into this issue community. Thanks.
 
Hi all,

I have a problem with this challenge : 

Write an Apex trigger that fires before records are inserted and ensures that the ShippingState field has the same value as the BillingState field.
Create an Apex class named AccountTriggerHandler that contains a public static method called CreateAccounts to accept the List of Account objects.
For each Account record, before saving, ensure that the ShippingState field has the same value as the BillingState field.
Write an Apex trigger named AccountTrigger that fires before records are inserted.
The Apex trigger must call the AccountTriggerHandler.CreateAccounts() method with the collection of new records.
Create a test class named AccountTriggerTest that inserts 200 Account records with a BillingState of CA. After the insert, test to ensure that all 200 records have a ShippingState of CA.
Before verifying this challenge, run your test class at least once using the Developer Console Run All feature.

and this is my classes :
 
public class AccountTriggerHandler {
    
    public static void CreateAccounts(List<Account> acclist){
        
        
        for(Account a:acclist){
            
            if(a.ShippingState!=a.BillingState){
                a.BillingState=a.ShippingState;
              
            }
        }
    }

}
 
trigger AccountTrigger on Account (before insert) 
{
    if (Trigger.isBefore && Trigger.isInsert) {
			AccountTriggerHandler.CreateAccounts(Trigger.new);
		}	
	}
 
@isTest
public class AccountTriggerTest {
    
    @isTest static void TestCreate200Records(){
        
        // Test Setup data
        // Create 200 new Accounts
        List<Account> accts = new List<Account>();
        for(Integer i=0; i < 200; i++) {
            Account acct = new Account(Name='Test Account ' + i, BillingState = 'CA');
            accts.add(acct);
        
            Test.startTest();
            //insert acct;
        	Test.stopTest();
            
            for (Account a:accts){
                
                System.assertEquals('CA', a.ShippingState, 'ERROR');
            }
            
    }

        
}
}
And this error :
Challenge Not yet complete... here's what's wrong: 
The 'AccountTrigger' Trigger does not appear to be working correctly. Inserted records did not have matching BillingState and ShippingState values.

Anyone can help me please??
Thanks!
 
Hi All,

I have a problem with this Challenge : https://developer.salesforce.com/trailhead/microsoft_dotnet/apex_basics_dotnet/execution_context

//AccountTriggerHandler

public class AccountTriggerHandler {
    
    public static void CreateAccounts(List<Account> acclist){
        
        
        for(Account a:acclist){
            
            if(a.ShippingState!=a.BillingState){
                a.BillingState=a.ShippingState;
              
            }
        }
    }

}
//AccountTrigger

trigger AccountTrigger on Account (before insert) 
{
    if (Trigger.isBefore && Trigger.isInsert) {
            AccountTriggerHandler.CreateAccounts(Trigger.new);
        }    
    }


//AccountTriggerTest
@isTest
public class AccountTriggerTest {
    
    @isTest static void TestCreate200Records(){
        
        // Test Setup data
        // Create 200 new Accounts
        List<Account> accts = new List<Account>();
        for(Integer i=0; i < 200; i++) {
            Account acct = new Account(Name='Test Account ' + i, BillingState = 'CA');
            accts.add(acct);
        
            Test.startTest();
            insert acct;
            Test.stopTest();
            
            for (Account a:accts){
                
                System.assertEquals('CA', a.ShippingState, 'ERROR');
            }
            
    }

        
}
}

Can you help me please??
Thanks!
Hello Community, 
I'm working on the "Setting up Lightning Connect - Pb with API Trailhead Module and after submitting the Check Challenge I've received this error below:

"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.ExternalObjectException: data.api.DataSourceException: This data is no longer available. The "Phone" table in the external data source is currently unavailable. Try again later or contact your administrator for help."


Has anyone come across this error, or have any ideas on what the issue is or on how to proceed to complete the challenge. Thanks.
 
Completed Step 2, Provision the Heroku Connect add-on. Filled out Phone Number changer form, and record successfully updated in my dev org. However, when I went to verify the step, got this error:
Step Not yet complete... here's what's wrong: 
The 'Tim Barr' contact record was not updated correctly in Salesforce. Please check your Heroku Connect setup. 
Note: you may run into errors if you've skipped previous steps.

Please advise. Thanks!

<aura:component controller="DisplayCaseController" implements="force:appHostable">
    <aura:attribute name="record" type="Case[]"/>
    <ui:inputNumber label="Case ID" aura:id="CaseID"/><br/><br/>
    <ui:button label="Get Case" press="{ !c.getCaseFromId }"/><br/><br/>
    <aura:iteration var="c" items="{!v.record}">
         <p>{!c.Subject} : {!c.Description} : {!c.Status}</p>
    </aura:iteration>
</aura:component>

 

 

client-side controller:-

({
    getCaseFromId : function(component) {
        var caseID = component.find("CaseID").get("v.value");
        var action = component.get("c.getCaseFromId");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.record", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    }
})

 

 

public class DisplayCaseController {
@AuraEnabled
public static Case getCaseFromId(Id caseID) {
if(caseID == null) {
return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
}
List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
if(cases.size() == 0) {
return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
} else {
return cases[0];
}
}
}

 

Challenge not yet complete... here's what's wrong: 
The client side controller does not refer to the 'getCaseFromId' method of the Apex controller class

Thnaks In Advance

Prashant

 

 

I realise this question has been asked a few times already but couldn't find any suggested solution that worked for me, so here goes.....

I am currently trying to complete the 'Using Expressions' challenge on the Trailhead Lightning site, and keep getting the same error.

Code
 Component
<aura:component >
    <aura:attribute name="IsSunday" type="Boolean" default="false"/>
    <aura:attribute name="IsMonday" type="Boolean" default="false"/>
    <aura:attribute name="IsTuesday" type="Boolean" default="false"/>
    <aura:attribute name="IsWednesday" type="Boolean" default="false"/>
    <aura:attribute name="IsThursday" type="Boolean" default="false"/>
    <aura:attribute name="IsFriday" type="Boolean" default="false"/>
    <aura:attribute name="IsSaturday" type="Boolean" default="false"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.IsSunday}">
    <p>Today is Sunday</p>
   </aura:if>
   <aura:if isTrue="{!v.IsMonday}">
    <p>Today is Monday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsTuesday}">
    <p>Today is Tuesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsWednesday}">
    <p>Today is Wednesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}">
    <p>Today is Thursday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsFriday}">
    <p>Today is Friday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsSaturday}">
    <p>Today is Saturday</p>
    </aura:if>
</aura:component>

CONTROLLER
({
    doInit : function(component) {
        var theDate = new Date();
        if (theDate.getDay()==0) {component.set("v.IsSunday", true);}
        if (theDate.getDay()==1) {component.set("v.IsMonday", true);}
        if (theDate.getDay()==2) {component.set("v.IsTuesday", true);}
        if (theDate.getDay()==3) {component.set("v.IsWednesday", true);}
        if (theDate.getDay()==4) {component.set("v.IsThursday", true);}
        if (theDate.getDay()==5) {component.set("v.IsFriday", true);}
        if (theDate.getDay()==6) {component.set("v.IsSaturday", true);}
    }
})

ERROR
Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ZPWCUPZG

I tried creating a new Developer edition, as per a suggestion on another thread, but got the same error (albeit with a different error id).

I went back to my original developer edition and tried another suggestion - modifying the code in my component to have only one <aura:if> statement and one <aura:set attribute....> tag, as shown below:

<aura:component >
    <aura:attribute name="IsSunday" type="Boolean" default="false"/>
    <aura:attribute name="IsMonday" type="Boolean" default="false"/>
    <aura:attribute name="IsTuesday" type="Boolean" default="false"/>
    <aura:attribute name="IsWednesday" type="Boolean" default="false"/>
    <aura:attribute name="IsThursday" type="Boolean" default="false"/>
    <aura:attribute name="IsFriday" type="Boolean" default="false"/>
    <aura:attribute name="IsSaturday" type="Boolean" default="false"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.IsSunday}">
    <p>Today is Sunday</p>
        <aura:set attribute="else">
                Today is not Sunday
        </aura:set>
    </aura:if>

<!-- Commented out code -->
    <!-- <aura:if isTrue="{!v.IsMonday}">
    <p>Today is Monday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsTuesday}">
    <p>Today is Tuesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsWednesday}">
    <p>Today is Wednesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}">
    <p>Today is Thursday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsFriday}">
    <p>Today is Friday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsSaturday}">
    <p>Today is Saturday</p>
    </aura:if> -->
<!-- Commented out code -->

</aura:component>

Same end result:
Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: MEEOAPTN

Any help would be appreciated. have spent quite a lot of time on this already!
Hello,
I can't manage to finish this challenge. I got this error : 
" The 'ShowAssistantInfo' page isn't referencing the Assistant Name variable."
I used the <apex:variable> to create the variables but still got the error.

Here is my code :
<apex:page docType="html-5.0" standardController="Contact" title="Assistant Information">
    <apex:variable var="AssistantName" value="{!Contact.Name}" />
    <apex:variable var="AssistantPhone" value="{!Contact.Phone}" />
	<p>Assistant : {!AssistantName}</p>
	<p>Phone : <a href="tel:{!AssistantPhone}">{!AssistantPhone}</a></p>
</apex:page>

Thanks

I'm following a well written tutorial written by @andymahood__c: http://www.tquila.com/blog/2014/11/17/setting-lightning-connect-and-your-first-external-object

When I get to the step #3 ... "Select Edit on the CustomerID field, ...", I don't see Account (or any objects to relate) listed in the drop down box. I have created the custom field on ACCOUNT named CusotmerID Text(5) and marked it as External ID as follows:

CustomerID CustomerID__c Text(5) (External ID) [Checked]

Any ideas?