Salesforce REST API - Usage of Search and parameterized Search
There can be scenarios where an external system would like to perform a search in salesforce with multiple objects. Recently we got a requirement to search for memberid in both Lead and opportunity and return resulted records. You can execute this in two ways. 1. Execute as 2 separate API SOQL query execution - one for Lead and one for Opportunity. 2. Execute Search through REST API The problem with the first approach is that you have to execute it as 2 separate transactions and it is time-consuming. To avoid that we can execute this using REST API search mechanism also. Search can be executed through REST using 2 approaches: 1. SOSL based Search 2. Parameterized Search Let us see both in detail. 1. SOSL Based REST API You can pass URL encoded text in SOSL query as a parameter and this will return details that match the search criteria. Please find the details of executing SOSL through REST below: Let us see how we can execute the above-mentioned search scenario. I am using...