1
votes

I am encountering a problem with the Two Options fields, having the Auditing option enabled in CRM 2011.

Since the CRM Two Options fields have a default value No/Yes by default, related audit records are always created for these fields on entity Create, when Auditing is enabled.

These field audits that include the default Boolean value (false/true), are in fact useless for the user, seeing that this initial unchanged value should be considered as Null. So, the audits should not be created and shown to the user in this case, especially when there are numerous Boolean fields and very frequent Create operations on the entity.

I could set the default value of the Two Options field twoOptionsField to null instead of false or true, by doing this on the form Load:

var twoOptionsField = Xrm.Page.getAttribute("twoOptionsField");
twoOptionsField.setValue(null); // set the value to null
twoOptionsField.setSubmitMode("always"); // store the null value

But this will automatically add the field audit with an empty value on Create.

Is there any efficient way we could avoid the audit records for initial "null"/default valued Two Options fields, having Auditing enabled, on entity Create?

1
Would it work to alter the setting using a plugin that reacts to Create message? (Not quite sure but it's an idea.)user1672517
Thank you for your suggestion. I will check if anything could work with a plugin reacting to Create message (Pre-operation), and will update you.amartine

1 Answers

1
votes

I don't know any setting to set that. One strategy you can have is in pre create\update of a entity check the value of that field and if is null you disable the audit feature for that field and if is not null enable the audit. The audit can be applied to organization\entity and attribute. I don't try this is just a ideia :D