• Mubashir
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
The use case is that customer is presented with a VF page to book a resource (typically a consultant) for number of hours on a particular date. Once customer selects a specific resource her/his availability calendar appears where start and end time can be selected to make a booking.

thanks
Referring to Developer Trail - Beginner: Inputting Data Using Forms, is it possible to have an lookup input field with the search icon giving ability to choose one from the list of existing records instead of creating a new one. e.g. <apex:inputField value="{! Contact.Account.Name}"/> renders the label and blank space for Account field for this Contact.

thanks
Hi,
I'm stuck on this trailhead challenge.
Here's the link of the challenge page:

https://developer.salesforce.com/trailhead/force_com_programmatic_beginner/apex_database/apex_database_sosl#challenge
and this is the error message that appears in red:

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 class:

//The apex class in public domain
public class ContactAndLeadSearch {
    
    //public static method that takes a String parameter
    
    public static SObject[] searchContactsAndLeads(String input) {
        
        //Create list of two lists, one for Contacts and the second for Leads
        List<List<SObject>> searchResults = [FIND :input
                                            IN NAME FIELDS
                                            RETURNING Contact(Name), Lead(Name)];
        
        //Place list of contacts at position 1 and leads at 2
        Contact[] searchContacts = (Contact[])searchResults[0];
        Lead[] searchLeads = (Lead[])searchResults[1];
        
        //return the two lists - I think this is where the problem is.
        return searchContacts;
        return searchLeads;
        
    }

}

After fiddling around a little I have managed to get to the stage where no problems appear in the Problems tab in developer console. But I suspect the code would only execute up to first return method on second last line 'return searchContacts;'

thanks
I'm stuck on the SOSL query challenge in trailhead. can't write the method.

cheers
The use case is that customer is presented with a VF page to book a resource (typically a consultant) for number of hours on a particular date. Once customer selects a specific resource her/his availability calendar appears where start and end time can be selected to make a booking.

thanks
Referring to Developer Trail - Beginner: Inputting Data Using Forms, is it possible to have an lookup input field with the search icon giving ability to choose one from the list of existing records instead of creating a new one. e.g. <apex:inputField value="{! Contact.Account.Name}"/> renders the label and blank space for Account field for this Contact.

thanks
I'm stuck on the SOSL query challenge in trailhead. can't write the method.

cheers