Another great feature of Microsoft CRM 4.0 is the Create Record option in the reworked Workflow. Being able to utilize this functionality opens the way to some interesting possibilities. The first one that we’ve utilized is an ownership audit trail for Contact records. We’ll also be using one of the new entity relationship options that have been added in Microsoft CRM 4.0.
The steps are pretty easy so let’s get started.
First we’ll create a new entity. This will be the entity that holds the ownership history so let’s name it “Ownership”. Additional info about the entity:
- Uncheck “Notes” and “Activities” (optional)
- Uncheck “Enable Duplicate Detection”
- Uncheck all the items in “Areas That Display this Entity”
- Under the Primary Entity, change the display name to “Details”
Save the new “Ownership” entity. Now we’ll create the relationships. Click on the “N:1 Relationships” and then “New Many to 1 Relationship”. We’ll create the relationship to Contact first, so choose Contact as the Primary Entity. Set the Display name to “Contact”. In the Display Option, use “Use Plural Name”. In the Display Area, choose the area you like, I opted for “Details”. That’s it so click Save and Close.
Now we’ll create the 2nd relationship, which is also an “N:1 Relationships”. This time the Primary Entity will be “User”. Make the Display Name “User” and under Display Option choose “Do Not Display”. This is an optional choice. If you want to see all the Contacts a User has owned from within their System User form, then go ahead and choose “Use Plural Name”.
Now let’s go the Attributes area of the Ownership entity and open the “Created On” field. Change the Display Name to “Assigned On”.
To get the Workflow to function correctly we’ll need to add some attributes to the Ownership form. Go to Forms and Views, open the form and add these to the form:
- Contact (optional)
- Assigned On
Save the form. Now we’ll modify the Ownership Associated View. Add the same columns to the view that you did for the form above.
We’re almost there, just have to set up the Workflow that will do all the lifting for us. Go to Settings then Workflows. Create a new workflow for the Contact entity and name it Contact Ownership. For the Scope I opted for Organization. For the “Start When” options, choose “Record is Created” and “Record is Assigned”. Now add a Step to the Workflow and that of course is “Create Record”. Choose “Ownership” as the record type and then click the “Set Properties” button to open the Ownership form. Click on the “User” field on the form and then on the right hand side of this window we’ll add a Dynamic Value. In Look for: choose “Owner (user)” and then below that choose “User” and below that, click “Add”. We’ll have similar steps for the next two fields. For the “Details” field we’ll first type in “Assigned By: “and then we’ll add a Dynamic Value. In “Look for” choose “Contact” and then choose “Modified By”. This will allow us to see who made the modification of changing ownership.
For QA reasons we can add another Dynamic Value for the Contact field, which of course will be “Contact” and then “Contact”.
Now save and Publish the workflow and we’re done.
To test, open a Contact record and assign it to another user. On the left navigation bar of the Contact entity click on the new Ownership button. In a few seconds you should have a new record displayed showing that you assigned this Contact and the details of when you assigned it as well as the new owner of the Contact.
Enjoy your new Audit Trail!
Microsoft CRM Consultant
Unitek Microsoft CRM Services