1

enter image description here

I have three objects:DNR,DNROLI and LCROLI.

DNR and DNROLI is having master-detail relationship,DNR being master. DNR and DNROLI is having look up relationship with LCROLI.

On LCROLI page,I have a DNR look up field which will give list of all DNRs and a look up field OLI which will give list of DNROLIs associated with the DNR selected in DNR look up field.And the Lookup dialog will show following fields:DNROLI,DNR and Material number (a custom field on DNROLI).

Now ,the problem is when I select search by all fields (radio button) and provide material number to search,I am getting list of DNROLIs but When I am doing same with DNR,no results are returned.

1
  • I have added screenshots.In first screenshot,I am searching by Material Number and getting a list of DNROLIs.In second screenshot,I am searching by DNR and no results are found.
    – devsfdc
    Apr 19 '16 at 11:31
2

I've seen this behaviour before and had the same question.

It looks like the search functionality only searches for data that is actually on the record itself. The 'DN-00461' value is not on the LineItem record but is fetched from the related Delivery Note, to be shown on the lookup screen (because that's more readable to the end user). The actual LineItem record only contains the Id of the Delivery Note (18-char SFDC Id).

This is also documented here: https://help.salesforce.com/apex/HTViewHelpDoc?id=search_fields_cex.htm&language=en_US

Quote: You can't search encrypted, formula, and lookup fields.

By the way: if you search by the Delivery Note Id, it will give you the correct results.. But that's not what your end users want, obviously.

If you need the lookup values to be searchable on the Name of the parent record, you need to explicitly copy that value to the LineItem record. Create a text field on LineItem that you update by workflow rules or APEX trigger upon each change to the Delivery Note field.

(Using a Formula field would appear easier but, as you can see in the docs, those are not searchable either).

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.