Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error: The object cannot be updated because it is read-only occurs when you try to revise or close a Quote in Microsoft Dynamics CRM 4.0


Symptoms

When you revise or close a Quote in Microsoft Dynamics CRM 4.0, you receive the following error message:

The object cannot be updated because it is read-only

The following information is part of the event: MSCRM Platform Error Report:

 >MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Number: 0x8004022E
Error Message: The entity cannot be updated because it is read-only.
Error Details: The entity cannot be updated because it is read-only.
Source File: Not available
Line Number: Not available
Request URL: http://localhost:5555/AdventureWorksCycle/sfa/quotes/edit.aspx?id={4B8CB804-B2C9-DE11-BD49-00155DF4750A}
Stack Trace Info: [CrmException: The entity cannot be updated because it is read-only.]
at Microsoft.Crm.ObjectModel.QOIService.Update(IBusinessEntity qoi, IBusinessEntity qoiPreImage, ExecutionContext context, Boolean calculatePrice)

↑ Back to the top


Cause

This problem occurs because a customization on the OnLoad or OnSave events tries to update an attribute property.

Example:

The following Javascript code is used to update the Quote Name attribute on the OnLoad Event:

crmForm.all.name.DataValue = “Example”;
crmForm.all.name.Disabled = true;
crmForm.all.name.ForceSubmit = true;

↑ Back to the top


Resolution

To resolve this problem, change the OnLoad or OnSave events to prevent the update action from being run on a disabled form. 

if (crmForm.FormType != 4)
{
crmForm.all.name.DataValue = “Example”;
crmForm.all.name.Disabled = true;
crmForm.all.name.ForceSubmit = true;
 }

↑ Back to the top


Keywords: kbmbsmigrate, kbmbspartner, vkball, kb

↑ Back to the top

Article Info
Article ID : 2006788
Revision : 1
Created on : 1/8/2017
Published on : 12/21/2009
Exists online : False
Views : 168