function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mkchourasiamkchourasia 

Lookup for a custom Object

I am trying to provide the lookup for a for a field with the Cusatom Object, but the lookup searches the data wrt only the ID not wrt the other fields. Thanks in Advance
WhyserWhyser

Lookups are designed to do lookups against the "Name" of the object, and it will return the ID of the object to be stored in your lookup field.

What exactly are you trying to accomplish?

mkchourasiamkchourasia
When I am trying to search a specific entry in the wrt name the search result is empty but when I search wrt ID it shows me all the data. Even while searching with wild card "*" its not giving me any data
WhyserWhyser

Okay, two things:

1) In the Salesforce documentation http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_sosl_find.htm

it says "Use an asterisk (*) to match one or more characters at the middle or end of your search term. Do not use the asterisk at the beginning of a search term"

If you tried putting an asterisk in the Salesforce Search functionality, it will tell you to put at least two characters in your search string.

2) Look at the way your custom object is set up. Under Setup -> App Settings -> Create -> Objects, go to your Custom Object and look at the "Standard Fields" section.

You should see the standard fields for all custom objects, the Created By, Currency, Last Modified By, and your {Object}_Name. The {Object} would be the name specified by how you created the object, and THAT field should be searchable. You can also set up that field as an auto-number, which will make only that field search-able.

Again, I'm not sure how you set up your custom object, but I have a feeling that you may have set it up as an auto-number, which is why it looks like it's searching for an ID.

mkchourasiamkchourasia
Thanks alot for ur reply. I am doing in the same way as you mentioned, but its searching on the bases of ID not according to specific field in the custom object
mkchourasiamkchourasia
In Custom Objects, can we reference to "Custom Fields" inplace of "Standard Fields" while providing the lokkup field in some other custion Object.