Scenario:
When I search for Opportunity with Opportunity name in Global Search, it should popup Project record also as a result.
Relationship b/w object
Opportunity has a one to many relationship with custom object called Project.
I want Project records also to be visible in search result.
Please suggest how it is possible.
Best Answer
Look up fields are indexed, but cannot be searched. If you want to have your project appear in the search results, it must contain text content that includes the project name.
One easy way to do to this is create a plain text field (does not need to be present on page layout), and a cross-object formula that copies the project name. After this, you simply create a workflow field update to copy the formula to the custom text field.
The formula field would simply be something like the following:
And the workflow field update would trigger on create and update, with a formula criteria of "true" (always executes), assigning the formula value to the text field. Afterwards, all project records must be touched once to update the custom text field. Once you do this, you can then search the opportunity name and find the related project(s). This is actually how we've implemented a similar feature in our org.