Wednesday, June 30, 2010

How to Find the Total Number of Records in an Account, Contact or Lead view

If you are here, you are probably aware that the most rows you can achieve in a CRM view is 250. Moreover, the views in CRM do not tell you the total number of records. Therefore if, for example, you want to know exactly how many contact records do not have the ‘gender’ attribute filled in (or whether it is male or female) it becomes a tedious process of getting the total number of pages, taking away 1,multiplying by 250 and adding the total number of records on the last page.

Here is a workaround.

Step 1: Create a Marketing List

image

Step 2: Add Marketing List Members using an Advanced Find Query that mimics the rules of the view in question

image

Step 3: Click the Find button and Add All Members Returned to the Marketing List

image

Step 4: Take a Good Look at the Marketing List Members Section of the Marketing List Record

image

There it is, above the action toolbar, the total number of members in the marketing list; in this case 1785.

Leon’s Quick Codeless Auditing Tool

The workflows in Dynamics CRM 4.0 are very powerful. Here is an example of an auditing tool which can be implemented without code, without additional attributes or additional entities and if you just need an audit log to roll back when people make mistakes, it should do the job.

Step 1: Setting up the Workflow

The workflow is pretty simple. All you do is create a note when a new record is created or when a specific field is changed.

image

In this case I’m auditing the first name attribute of the Contact record. The details of the note are thus:

image

That’s 90% of the work now done. We publish and the engine is in place.

Step 2: Make some changes

When we create a new contact or change the ‘First Name’ field, a new note will be created against the contact showing the current value. To determine the previous value we look back through the notes.

image

If there are extensive notes, we can use Advanced Find

image

image

We can even save the Advanced Find as a View and while there is no simple way to access the log through the interface, we can always go to Advanced Find – Saved Views.

Each time you need to audit a new field you just create a new workflow. If you are monitoring many fields, a plugin may be a better option but if you need an audit tool to manage a few key fields and don’t want to spend a lot of time messing about, this should do the trick.