In some cases, you want to delete a custom field in a highly used entity. You can easily identify where it appears in system views, forms, etc. But since it’s, many users probably have personal views that include it. So you have to alert those users to remove it from their views, so they don’t get an error message later on after you delete the field.
If a field is deleted and used on a personal view, the following error is displayed on the view: 0x80041103 Query Builder Error
I suggest using a console application with the Impersonation principal to know exactly the personal views that use a given field. Indeed, all personal views are stored at the userQuery entity.
Doc: “Impersonation is used to execute business logic (code) on behalf of another Dynamics 365 for Customer Engagement user to provide a desired feature or service using the appropriate role and object-based security of that impersonated user.”
In the code below, I display all Contact’s personal views using the custom field “mel_contactnumber” and their owner.
One thought on “Retrieve all personal views containing a specific field”