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
chiranjeevitgchiranjeevitg 

Filter criteria for Master - Detail Relationship

Hi,

 

I have one standard Object Campaign and one custom object sub campaign. I want to add filter criteria in master detail relationship while Sub-Campaign looking up the records in Campaign object. But while creating the Master - Detail relationship or Lookup relationship i didn't find adding filter criteria on that. I want to lookup the campaign records based on record type.

 

Please help me to solve this issue.

Pradeep_NavatarPradeep_Navatar

To define a lookup filter:

 

1. You can create lookup filters for new relationship fields in step 3 of the custom field wizard. To create a lookup filter on an existing field:

   a. Navigate to the fields area of the object that contains the relationship field:
          * For standard objects, click Setup | Customize, select the appropriate object from the Customize menu, and click  Fields.
          * For custom objects, click Setup | Create | Objects, and select one of the custom objects in the list.
   b. Click Edit next to the name of the lookup or master-detail relationship field to which you want to apply the filter.

2. In the Lookup Filter Options section, click Show Filter Settings.


3. Specify the filter criteria a record must meet to be a valid value. To specify criteria, click Insert Suggested Criteria and choose from a list of suggested criteria, or manually enter your own criteria. To enter your own criteria:

   a. In the first column, click the lookup icon or start typing in the text box and select a field.
   b. In the second column, select an operator.
   c. In the third column, select Value if Salesforce.com should compare the field in the first column with a static value, or select Field if Salesforce.com should compare the field in the first column with the value of another field.
   d. In the fourth column, enter the value or select the field that Salesforce.com should compare with the field in the first column.

4. Specify whether the filter is required or optional. For fields with optional lookup filters, only values that match the lookup filter criteria appear in the lookup dialog initially; however, users can click the Show all results link in the lookup dialog to remove the filter and view all search result values for the lookup field. Also, optional lookup filters allow users to save values that don't match the lookup filter criteria, and Salesforce.com does not display an error message if a user tries to save such values.

  For required lookup filters, specify whether you want Salesforce.com to display the standard error message or a custom message when a user enters an invalid value.


5. Optionally, enter text to display in the lookup search dialog. Consider text that guides users in their searches and explains the business rule that the lookup filter implements.


6. Leave Active selected.


7. Click Save.

 

Did this answer your question? If so, please mark it solved.

chiranjeevitgchiranjeevitg

Hi Thank u very much for your reply....

 

 

Here the problem is i'm unable to see the "Show Filter Settings" as you mentioned in Step 2.

 

But i have checked with different standard object lets say Contacts, where i can able to see this option.

 

Here i'm looking up Campaign(Standard) from Sub-Campaign(Custom object)

 

Can you please help me to solve this.

indyindy

Hi,

Did you get any solution for this.

I am facing the same issue like ,when I create a new lookup field(which is lookup to product) the filter option is not visible for me.

Please reply if you have solution.

 

Thanks,

Indy

 

VPrakashVPrakash

I think this notes: https://login.salesforce.com/help/doc/en/fields_lookup_filters_notes.htm will answer your issue. Salesforce supports lookup filters on certain objects.