nerdexam
Salesforce

PDI · Question #73

What should a developer use to obtain the Id and Name of all the Leads. Accounts, and Contacts that hove the company name "Universal Containers"?

The correct answer is A. FIND 'Universal Containers' IN Name Fields RETURNING leadjid, name), accounted, name). To query across multiple objects (Leads, Accounts, Contacts) for a specific company name and retrieve Id and Name fields, a SOSL (Salesforce Object Search Language) query is the appropriate tool.

Submitted by luis.pe· Apr 18, 2026Data Modeling and Management

Question

What should a developer use to obtain the Id and Name of all the Leads. Accounts, and Contacts that hove the company name "Universal Containers"?

Options

  • AFIND 'Universal Containers' IN Name Fields RETURNING leadjid, name), accounted, name),
  • BFIND Universal Containers' IN CompanyName Fietds RETURNING lead{ld. name), accounted,
  • CSELECT lead(id, name). accountOd, name), contacted, name) FROM Lead, Account, Contact
  • DSELECT Lead.id. Lead.Name, Account.Id, AccountName, Contacted, Contact.Name FROM

How the community answered

(27 responses)
  • A
    89% (24)
  • C
    7% (2)
  • D
    4% (1)

Why each option

To query across multiple objects (Leads, Accounts, Contacts) for a specific company name and retrieve Id and Name fields, a SOSL (Salesforce Object Search Language) query is the appropriate tool.

AFIND 'Universal Containers' IN Name Fields RETURNING leadjid, name), accounted, name),Correct

This is the correct syntax for a SOSL query, which is used to search across multiple standard and custom object fields for a specific text string. The `RETURNING` clause specifies which objects and fields to retrieve when a match is found in `Name Fields`, which typically include the company name for these objects.

BFIND Universal Containers' IN CompanyName Fietds RETURNING lead{ld. name), accounted,

The `CompanyName Fields` is not a valid search group in SOSL; `Name Fields` is the appropriate general search group for names and company names on these objects, and it's missing `contact(id, name)`.

CSELECT lead(id, name). accountOd, name), contacted, name) FROM Lead, Account, Contact

This is not valid SOQL or SOSL syntax; SOQL uses `FROM` with a single object (or related objects), and this structure does not exist for searching across multiple unrelated objects.

DSELECT Lead.id. Lead.Name, Account.Id, AccountName, Contacted, Contact.Name FROM

This is incomplete and invalid SOQL syntax. SOQL queries operate on one primary object at a time unless using relationships, and this syntax attempts to select from multiple unrelated objects directly.

Concept tested: Salesforce Object Search Language (SOSL)

Source: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sfdc_sosl_examples_return_multiple_objects.htm

Topics

#SOSL#Data Querying#Multi-object Search#Standard Objects

Community Discussion

No community discussion yet for this question.

Full PDI Practice