This same sort of error might occur when reactivating any record, but the specific instance was an error when attempting to reactivate a case in CRM. The error returned in a trace is: The object cannot be updated because it is read-only. This error message doesn't help much, because of course the object is read-only. However, this message is actually being returned by an attribute on the case, and the problem at hand is some javascript.
Thanks to the conversation here, I was able to determine that the problem is in the OnLoad() script, where I was setting a few attributes to ForceSubmit = true. This script is actually firing when I open the read-only record, which normally has no effect because the record cannot be saved. However, upon trying to reactivate, the system is performing a save operation, but the ForceSubmit is trying to submit the value in the attribute before the record becomes read/write again. Hence the above error.
The solution here is to simply wrap the ForceSubmit statements in an IF statement to make sure that they only fire on create or update forms and not on read-only forms.
Showing posts with label error. Show all posts
Showing posts with label error. Show all posts
Wednesday, May 19, 2010
Monday, April 13, 2009
Unable to publish workflows after update rollups
I just encountered an interesting problem today where I was unable to publish a workflow - the friendly error message said "An error occurred when the workflow was being created. Try saving the workflow again". I found a handy discussion here: http://social.microsoft.com/forums/en-US/crm/thread/78a7f940-50de-4f83-a38d-54425dd0ec1c/ that explains the solution. This seems to have started with Update Rollup 2 (and in this case I just applied UR 3 last week) and just requires adding an assembly line to the web.config in the section :
I didn't even need to reset IIS and the workflows started publishing again.
I didn't even need to reset IIS and the workflows started publishing again.
Subscribe to:
Posts (Atom)