You need to sign in to do that
Don't have an account?

Setting SOSL Name Fields
Based on the SOSL documentation it appears that you can limit the searched fields to, among other things, Name Fields. The documentation makes it sound like you can designate certain fields to be Name Fields, but I have not been able to figure out how to do this.
Is it possible to designate an arbitrary field as a Name Field on an object, and if so, how is this done?
Is it possible to designate an arbitrary field as a Name Field on an object, and if so, how is this done?
Name Fields in the SOSL syntax refers to the actual singular Name field that is on most standard objects and all custom objects.
There are some additional fields that are searched on standard objects when you use Name Fields in a SOSL search. You'll find those special cases here - https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_in.htm
Also, here is a page in the docs that describes the isNameField() method and states that "objects can have only one name field..." - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isNameField
Hope that helps,
Clint
All Answers
Name Fields in the SOSL syntax refers to the actual singular Name field that is on most standard objects and all custom objects.
There are some additional fields that are searched on standard objects when you use Name Fields in a SOSL search. You'll find those special cases here - https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_in.htm
Also, here is a page in the docs that describes the isNameField() method and states that "objects can have only one name field..." - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_fields_describe.htm#apex_Schema_DescribeFieldResult_isNameField
Hope that helps,
Clint
Well, that clears things up. Thanks for clarifying things.