Featured Post

Web API Requests Series

Web API Series:  Create and Retrieve , Update and Delete , Retrieve Multiple , Associate/Disassociate , Impersonation , Run Workflows

Showing posts with label read-only field. Show all posts
Showing posts with label read-only field. Show all posts

25 March 2012

Read only fields are not saved.

If you are writing your custom web resource and using it to update standard crm fileds, rememember that they will not be saved if they are read-only.
Let me make myself clear with an example.
I was developing an HTML web resource and I was changing the value of a field only shown on the footer. In order to be able to change the value of that field I had to place it on the form as well and hide it. This means that I set, from the form designer, the following properties:
  1. Visible by default = false
  2. Field is read-only = true
If you do this you will be able to access the read-only field but when you save the form that field will not be saved because is read-only.
So what you should do is: Hide the field on the form but don't set the field to be read-only as shown below.















If it is a bug or it is normal, I don't know. If someone knows the reason of this behavior please let me know.
Thank you.