Search code examples
dynamics-crmdynamics-crm-2013microsoft-dynamicsdynamics-crm-2016

Issue with lookup filter criteria and subgrid issue in a specific scenario


Following is the exact scenario in my Dynamics CRM application:

There are two entities "Departments" and "Employees", where there is 1:N relationship from Departments to Employees.

I have created a lookup view on Employees which is expected to display only those employees who has no departments associated.

There is a subgrid in Department form which allows users to select Employees for the Department.

This all works fine, until user tries to create a new Employee from within Department page. It successfully creates the Employee and also associate it with the Department but as the Employee's lookup view is set to list only employess having no department, this displays a message saying "No records found. Create a new record". This is because the newly created employee has department associated with it. Message is the only issue, whereas the data seems ok. This message is annoying to the end-users for obvious reasons. When a user clicks anywhere on the form, the error disappears.

Any suggestions on how to deal with this issue?


Solution

  • I'd hide the grid it it's empty, and then show a webresource that displays a message that all employees have a Department. You could even create a button that would allow them to create a new employee as well, if you want the functionality on the Department form.