简体   繁体   中英

How to get recent records

There is an option in mscrm to see recent records (the "timer" button) how can I get this functionality? or how to get recent viewed records?

Since your profile says you are a JS developer I am guessing that you are asking for a way to programmatically retrieve the recent records for any user.

There is a table in D365 called "userentityuisettings" (user entity UI settings) that holds each users recently viewed records and views in an XML format. You can query this table using XRM Toolbox's FetchXML builder to see what is in it. Here is an example query:

<fetch>
  <entity name="userentityuisettings">
    <attribute name="owninguser" />
    <attribute name="objecttypecode" />
    <attribute name="lastviewedformxml" />
    <attribute name="recentlyviewedxml" />
  </entity>
</fetch>

You will have to parse the XML to collect the GUIDs of the records, and then run additional queries to get the names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM