Readonly Fields and The Dynamics CRM Workflow Editor

I ran across an issue this week creating a workflow for an entity that had fields set to read-only.

If you’ve never run across this before, setting the Read Only property on a field will not only restrict the modification of field data to the user, but also when working with the CRM workflow editor.

There are several ways around this type of problem:

Option 1: JavaScript

The first option you have is to use JavaScript to set the fields in question to disabled, using the Form Type to determine when that piece of code should work.

While this works, there is now an extra piece of code that must be maintained by someone.

Option 2: Manually change the fields

The second option is for you to remove the read only property from the fields, publish the entity, create your workflow, then reverse the process and make the fields again read only.

While this works, it is a serious pain in the neck and not very maintainable, should you need to make frequent changes.

Option 3: Business rule

I have not tried this option, but I think it is possible, but I don’t have direct knowledge of the interaction between the business rules and the workflow editor.

Another topic for a future blog.

Option 4: Administration Form

This is, by far, the most elegant solution I think, and the one I chose to implement:

Tip #265: Administrator updates of read-only fields