How to filter lookup records in Dynamics 365?
Scenario: Imagine you have a list of cases in an Opportunity form, and you click on a field called "Case." Right now, it shows all cases, including the ones that are no longer active. But I only want to see the cases that are still active, not the inactive ones. So, we'll set it up to only show the active cases. You can do the same with other filters if needed.
Follow the video below to see the implementation.
Filtering a lookup field in a Dynamics 365 form allows you to restrict the choices available in the lookup based on certain criteria. This can be particularly useful when you have a large dataset and want to help users find and select the right record quickly. You can use multiple filter criteria by clicking the "Add Condition" button in the "Add Custom Filter" dialog, allowing for more complex filtering conditions.
Prerequisites:
Before we begin, make sure you have the necessary permissions to customize forms in Dynamics 365. You should also have a basic understanding of how to navigate and use the Dynamics 365 platform.
Steps to Set Up a Filtering Condition for a Lookup Field to Display Only Active Cases:
1. Log in to Dynamics 365:
Start by logging in to your Dynamics 365 account with the appropriate credentials.
2. Navigate to the Opportunity Entity:
Go to the area where your opportunities are managed and locate the Opportunity entity.
3. Customize the Opportunity Form:
- Click on "Settings" (represented by a gear icon) in the upper-right corner.
- Select "Advanced Settings."
- In the new window, choose "Customizations" and then "Customize the System."
4. Edit the Opportunity Form:
- In the Solution Explorer, expand "Entities" and select "Opportunity."
- Under "Forms," find and select the form you want to customize (typically "Main Form").
- Click on "Form Properties" in the ribbon.
5. Add a Subgrid for Case:
- In the form designer, locate where you want to add the list of cases.
- Drag and drop a "Subgrid" control onto the form.
6. Configure the Subgrid:
- After adding the Subgrid control, double-click it to configure its properties.
- In the "General" tab, choose the "Cases" entity as the data source.
7. Set the Filter Criteria:
- In the "Data" tab of the Subgrid properties, scroll down to "Add Predefined Filter" and click on it.
- Define a filter criteria that displays only active cases. For example, you can set the "Status Reason" field to "Active."
- Save and close the Subgrid properties.
8. Publish Customizations:
After configuring the Subgrid, make sure to save and publish your customizations.
9. Test the Form:
Go back to your Opportunity entity and open an opportunity record. You should now see a list of cases related to that opportunity, filtered to display only the active cases.
Conclusion:
Customizing Dynamics 365 forms to display specific information, like showing only active cases in an Opportunity form, can greatly enhance your organization's efficiency and user experience. By following the steps outlined in this blog post, you can easily set up a filter condition to meet this requirement and ensure that your team works with the most relevant data.
No comments:
Post a Comment