toto1999
toto1999

Reputation: 213

How to get last created record in an entity in dynamics crm online?

I need to create a view in a page and this view must contain only the last created record. I tried with view filter but it doesn't allow to get the last created record. Is there any way to do this please?

Thanks in advance,

Upvotes: 2

Views: 2486

Answers (1)

Polshgiant
Polshgiant

Reputation: 3664

  1. Create a system view on your target entity that is sorted by createdon descending and then publish the entity. This query will return multiple records, and the most recently created one will be at the top.
  2. Download the XrmToolbox, unblock the zip, and extract it somewhere on your hard drive.
  3. Download FetchXML Builder XrmToolbox plugin, unblock the zip, and extract it into XrmToolbox's plugins folder.
  4. Start XrmToolbox, connect to your org, and click the FetchXML Builder tool.
  5. Open -> View -> specify your entity (I had to play with the autocomplete box a little bit to get it to work) -> select the view you created in step 1. This will load the view in the builder.
  6. Select the Fetch node in the tree on the left. On the right, you will see a field called Top. Specify 1.
  7. Choose Save->Save View. That should do it!

Upvotes: 3

Related Questions