Wednesday, December 3, 2014

Strange behaviour of the two options(Boolean) field in CRM2013

Last week, I came across a strange behaviour of the two options field in CRM2013. I am not sure if it is a bug or it is by design.

Scenario

I have a boolean field on an entity. This field is not added to the form. The default value of the field is set to false. When a new record is created in CRM, the integration process copies the record into the external system and updates the boolean field to true in the CRM. This boolean field indicates if the record is copied to the external system or not.

It works perfectly expect in the following scenario.

If the user updates the  record immediately after creating the record without closing the form, CRM will reset the value of the boolean field back to false. According to me, it is a bug. CRM should not pass the un modified fields to the save method.

The following screen shot displays the audit history of the field.

image

Solution

Add the field to the form.