UserQuery (saved view) entity

Applies to Dynamics 365 (online), version 9.x

Saved queries are business entities that define the parameters and criteria of a Dynamics 365 database search. Saved queries support cross-entity searches. In Dynamics 365 there are two entities available for queries against the Dynamics 365 database.

A user query, called a saved view in the application, is owned by an individual user, can be assigned and shared with other users, and can be viewed by other users depending on the query's access privileges. This is appropriate for frequently used queries that span entity types and queries that perform aggregation. A saved query, called a view in the application, is owned by an organization making it visible to all users in the organization. Saved queries (views) are used for both views defined for an entity and for filters and templates for Dynamics 365 for Outlook. For more information about saved views, see Customize Entity Views in Dynamics 365 and Offline and Outlook Filters and Templates.

A query in the form of a FetchXML statement is constructed and then assigned to the UserQuery.FetchXml attribute. This query can be executed by using the ExecuteByIdUserQueryRequest message.

You can see the user query (saved view) in the Advanced Find section of the Dynamics 365 application and also in the View drop-down list for an entity. You can export the value of the UserQuery.FetchXml attribute by using the Download Fetch XML button in the Advanced Find dialog box.

See also

Model Your Business Data With Dynamics 365
UserQuery Entity Building Queries with QueryExpression
Fetch XML Schema