top of page

[TIPS] track the export to excel Operations in your dynamics crm instance

  • Writer: Amraoui Hamza
    Amraoui Hamza
  • Aug 20, 2021
  • 1 min read

Create a plugin and entity to track all the export to excel operation in your CRM

There's no way to track the export excel operation from your dynamics CRM instance, but there's a trick to create your own logger, keep reading to understand the trick behind.


We are going to use the Retrieve Multiple Message from the SDK Message, don't worry, we are not gonna impact your dynamics instance performance just keep reading.


First : Create a Custom Entity for logs with the Fields You want

For example these's the fields of my entity :

Entity Name - Exported view name - Layout XML - Fetch XML Filter - Export Date - Exported By


Second : Create a new Plugin Class

- I did a check on the MessageName, continue just in case of MessageName == ExportToExcel OR MessageName==ExportDynamicToExcel (because we are using the RetrieveMultiple Message used in loading grids, lists ...)


- The second check is to create one record for each export (because if you want to export excel from Advanced Find for result more than +5000 records, in this case we will have pagination, for each page is a new request => plugin invoked) may you are going to think about the depth as i did, but you can't use it because for depth = 1 we have the same request with different PageNumber.



After that you can create your log record from the params in the context, check the full code here


Third : Create Step For Your Plugin

After creating your plugin, it's time to create the step.



The full code is available here :


I hope it helps.

Hamza




Recent Posts

See All

Yorumlar


JOIN OUR MAILING-LIST

Keep in touch

Thank you !

bottom of page