Before we begin any coding we must gather business requirements. For a small solution like a usage logger we don't need a spec or some large Wiegnarian document. However if you are building something larger: gathering requirements in a consistent and professional manner is critical.

Here are the requirements which I sketched out for the solution:

The purpose of this solution is to create a record of user actions to measure adoption. The solution shall record create, read, update and delete actions performed on all customizable and custom entities within a Microsoft CRM 3.0 implementation. This actions should be written to a normal CRM entity which is available for querying and reporting. Create, Read, Update and Delete access to the CRM log entity shall be restricted to a subset of users.

Let's dissect these requirements to see what kind of technical design we might use. We need to monitor the classic set of CRUD actions performed by the system. A callout seems like a likely candidate since it can monitor Create, Update and Delete events. We'll also need to monitor the Assign and Set State events as these are a subset of Update. For Reads we have the weakest solution as we will need to do something to the Forms and we have no possible solution for Reads on the Grid.

At this point we would want to go back to our 'customer' and discuss the Read issue. If they plan to really use this solution for security purposes then monitoring Reads via a form event is probably not a great solution. An example might be a police department wanting to know who had viewed someone's criminal record etc. If we really are just monitoring adoption then everything should be OK. It always pays to double check 'borderline' requirements like this.

In Summary: We will collect the actions using a callout (a post callout to be precise) and a JavaScript event on the Form. We'll need to write the data into a CRM entity and set it's permissions accordingly.

Next: In Part 3 we will create the CRM Entity to store the Logs.

This posting is provided "AS IS" with no warranties, and confers no rights.

Tags: