#1 Salesforce Training Tutorials
https://www.sown.io
Promote Your Salesforce App on This Channel:
• Marketing your Salesforce App on Sale...
FULL PLAYLIST:
• Salesforce Trailhead - Developer Begi...
Learning Objectives
After completing this unit, you’ll be able to:
Execute a SOQL query using the Query Editor or in Apex code.
Execute a SOSL search using the Query Editor or in Apex code.
Write an Inline SOSL Search to Return Database Values
Now that you’ve successfully avoided collision with asteroid 2014 QO441, contact Mission Control at the Neptune Space Station to get cleared for landing so you can take a well-deserved break. Write an inline SOSL search to find and return the contact details of the Mission Specialist at the Neptune Space Station.
Using Execute Anonymous, like we did when we inserted records for the Control Engineers, insert the contact details for the Mission Specialist on Neptune.
Contact thisContact = new Contact( Firstname='Brian', Lastname='Dent', Phone='(619)852-4569', Department='Mission Control', Title='Mission Specialist - Neptune', Email='[email protected]');
insert thisContact;
Search for the inserted record with an inline SOSL search, using Execute Anonymous. Instead of finding 'Crisis', like we did when we used Execute Anonymous to look for the Control Engineers' records, search for 'Mission Control'. Use the System.debug() method to display the contact's "lastname, firstname" in your debug log .
Make sure that you see the returned records in the debug log.