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.

Current Search Result

I want Project records also to be visible in search result.

Please suggest how it is possible.

  • Did you click the "search all" on that screen? If not try it and see if records are displayed you should see at a min "projects (x)" even if x is 0 . If they still are not the try the answer below. If that does not work then the search index may not be created yet if the records are newly created. – Eric Mar 23 '17 at 2:32
  • Thanks Eric. In global search I have all object visible, project too but in search record is not coming. – Ajay Gupta Mar 23 '17 at 3:25
  • So you see "project (0)" along the left side? And did you click search all on the search results screen? – Eric Mar 23 '17 at 3:25

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.

| improve this answer | |
  • I think you have the right answer about the records needing to store the text that you want to be able to search, but you don't really need a formula field for this since the field update can set field values with a formula by itself. – martin Mar 23 '17 at 5:00
  • @martin why add a WFR and field update and have to update existing records when you can use a formula field. Technically you don't need a field update because a formula will work better – Eric Mar 23 '17 at 5:34
  • @sfdcfox. Nice catch. Did not even realize op was trying to search opp name and only had lookup – Eric Mar 23 '17 at 5:35
  • @Eric is a formula field sufficient to have the record show up in a global search? – martin Mar 23 '17 at 5:37
  • @martin to pull in the opp name, yes – Eric Mar 23 '17 at 5:38

Following things to be configured for custom object (Project):

  1. Allow search checkbox to be selected at Object definition.
  2. The tab to be created for this object and should not be Tab Hidden in that user's profile who is searching for the results.

Now, you will see the Project records based on the matching search values.

| improve this answer | |
  • Santanu, your answers are usually excellent (I'm a fan!), but this answer happens to be incorrect. I'm not the downvoter, but it's easy to see why someone might do so. – sfdcfox Mar 23 '17 at 3:50
  • I think I didn't understood the question – Santanu Boral Mar 23 '17 at 3:56
  • It's okay, Santanu, the question not exactly literary artwork. We all get downvotes (yes, even me) from time to time, and we should consider it constructive criticism. I just wish the downvote system required comments, because it's hard to know what went wrong when there's no comment. I know your heart was in the right place, I was just trying to help. – sfdcfox Mar 23 '17 at 4:03
  • @sfdcfox, if my answer is incorrect, then it should be downvoted, I could learn from mistake. But here question is not clear. – Santanu Boral Mar 23 '17 at 4:46
  • Totally agree; the question could use some work, and I don't think that should reflect on you. Unfortunately, this kind of happens sometimes. I'm kind of confused how this question has +2 already. I'd guess we should probably take this up on meta, but I most new users don't use meta. – sfdcfox Mar 23 '17 at 4:48

First make sure that search option is selected for object. As project is custom object it will be available under object

| improve this answer | |
  • Off course it is available. I am able to search Project records by searching Project data values like Project name. – Ajay Gupta Mar 23 '17 at 0:54

AFAIK Global search only return the record tat matches the keyword entered...

To display related record for opportunity you have create custom search

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.