• Edward Brunton
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
Apex Basics & Database Unit 5/5

Hello, Community, I am facing problem in solving this challenge, please advise.

Here is the criteria presented: 

With SOSL you can search against different object types that may have similar data, such as contacts and leads. To pass this challenge, create an Apex class that returns both contacts and leads that have first or last name matching the incoming parameter.

The Apex class must be called 'ContactAndLeadSearch' and be in the public scope.
The Apex class must have a public static method called 'searchContactsAndLeads'.
Because SOSL indexes data for searching, you must create a Contact record and Lead record before checking this challenge. Both records must have the last name 'Smith'. The challenge uses these records for the SOSL search.
The return type for 'searchContactsAndLeads' must be 'List<List< SObject>>'
The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records.

Error received: 

Challenge not yet complete... here's what's wrong: 
Executing the 'searchContactsAndLeads' method failed. Either the method does not exist, is not static, or does not return the expected search results.

Here is my code:

public class ContactAndLeadSearch{
    public static List<List< SObject>> searchContactsAndLead(String name)
    {
        List<List<sObject>> result=[FIND :name IN ALL FIELDS RETURNING Lead(LastName),Contact(LastName)];
                return result;
    }
}


PLEASE ADVISE...Thanks Community!!!
Working on TrailHead Challenge... (https://developer.salesforce.com/trailhead/force_com_introduction/data_security/data_security_sharing_rules)

Tasks completed:
The custom object must be named 'Project' with a resulting API name of 'Project__c'.   Done
The Name field for 'Project' must be of type Text (not Auto-Number).  Done
The custom object 'Project' must have a custom field of type picklist named 'Priority' with a resulting API name of 'Priority__c'. Done
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.   Done
Set the organization wide settings to public read only.    Done

Here is where I think is the problem:
The sharing rule can be named anything.  
 
Create sharing rule under "Sharing Settings" under Project Sharing Rules..  Create a criteria based project sharing rule with Priority custom field equal to High.  Shared with role "Training Coordinator" as read-only access.


What am I missing?
Hi 
I am working on Trailhead module: Test your Process. I followed all the steps in creating Process Builder through Trailhead and I am getting below error:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Account number must be 8 characters long: []
Can one of you help or let me know, what I am doing wrong.
Thanks