Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 123975

Blog Post: How NOT to lose valuable auditing information!

$
0
0

The concept of minimalism in art and design is all about eliminating the non-essentials and only using what is required. This is also a good approach when creating your Managed Solutions as CRM member Ben explains below. Please note the information below is also very relevant if you’re going to be using third party Managed Solutions to ensure that importing their solutions does not cause unintended consequences. If you'd like any more information, please ring or email me.

The Problem

We recently had one of our customers contact us as they'd lost some auditing information regarding their Account records. After some investigation it turned out that this was caused by an update from a third party's Managed Solution. The import of the Solution had turned off auditing on the Account entity.

The actual change to the Account entity should have had minimal impact as it was just adding a new field to the form, but, and this is the important bit, by default all of the main entity settings (or Metadata) are exported when a Managed Solution is created.  These are basically the checkboxes that can be selected on the entity's customisation page. 

Some of these important settings are:

  • Auditing required
  • Showing the entity in Mobile Express
  • Whether the entity supports queues and whether records should automatically be moved into the owner's queue when created or assigned
  • Duplicate Detection

Apart from the inconvenience of settings being changed, turning off auditing, can be a major headache for companies.  This is due to the fact that turning off auditing is likely to mean you will lose previous audit entries.  If you try to turn off the auditing on an entity from within CRM you're warned "If you disable auditing, some change history data may be lost. Do you want to continue?", but unfortunately you don't get this warning when importing solutions.  There is an argument that CRM should provide more granularity around the import process, but that's another story.

The Solution

CRM Solutions are used to package up customisations in CRM.  Going into the specifics of these solutions is outside the scope of this post, but basically they are a number of customisations contained in a zip file.  If you want to learn more about Solutions then please read the article here Introduction to Solutions.

We are interested in the customizations.xml file contained in the zip file, and we are going to edit this to minimise the impact when it's imported into CRM.  The editing of this file is not a supported change for CRM, but it is necessary to avoid adversely affecting a customer's environment.  The actual change we'll make is to avoid turning auditing on or off for a customer, but the same approach can be taken for any of the settings.

The steps will involve unzipping the Solution, editing the customizations file, and then re-zipping the files.  For these steps I'm going to update a Solution called AddAccountField, which adds an extra field to the Account entity.  My customer already has auditing turned on for the Account entity, so I'm going to ensure that this setting is not turned off when importing the Solution.

Step 1 - Unzip the solution

This first step is very straight-forward...just locate the zipped solution file and extract it's contents.  Depending on the Solution you're editing this will extract three xml files and zero or more folders.

Step 2 - Update the Customizations.xml

In the next step we are going to open the customizations.xml, and then locate and remove a setting.  These changes can be made in Notepad, but I would suggest you either use Notepad++ or your favourite XML editing tool.  This example will use Notepad++ as it's free and very powerful.

  1. Open the customizations.xml file
  2. Search for <entity Name="Account">

  3. The entity settings are below the attributes section, so we will collapse the attributes section.

  4. Scroll down the file to locate the setting called Is AuditEnabled as highlighted below.

  5. For safety we will just comment out this setting as can be seen below.

  6. Save the file and close Notepad++

Step 3 - Re-zip the solution

In this final step we will zip the contents of the Solution back up into a new zip file.

  1. Select all the files and folders previously extracted

  2. Right-click on any selected file and choose Send to->Compressed (zipped) folder

  3. This will create a ZIP file with a name of one of the files/folders selected, so you should rename this to something appropriate.

We now have a Solution that can be safely imported into a customer's environment without affecting the current auditing setup on the Account entity.

To follow the minimalist approach the Solution should be updated to only include those settings/customisations that are needed for the Solution to work correctly.  This means you can remove all the settings for an Entity that are not applicable to the Solution.

We have asked our customer to contact us next time an update is released for their Managed Solution, so we can assess the impact and edit the contents if required.

Please get in touch if you have any questions regarding the steps above.

-------------------------------------------------------

Kristy Brown

Dynamics CRM Service Line Manager

Koorb Consulting

+64274 774 384

The article How NOT to lose valuable auditing information! was first posted at Koorb Consulting

 


Viewing all articles
Browse latest Browse all 123975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>