This question is locked. New answers and comments are not allowed.
Hi,
I got this error when I tried to update an existing record, please see below:
Server Error in '/' Application.
The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Telerik.OpenAccess.Exceptions.InvalidOperationException: The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed.
Source Error:
Line 86: set
Line 87: {
Line 88: this._organization = value;
Line 89: }
Line 90: }
Source File: c:\Projects\ProjectName\Project.Data.OA\Entities\Contact.generated.cs Line: 88
Stack Trace:
[InvalidOperationException: The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed.]
Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
OpenAccessRuntime.ExceptionWrapper.Throw() +42
OpenAccessRuntime.DataObjects.PCStateMan.handleException(Exception x) +106
OpenAccessRuntime.DataObjects.PCStateMan.setStringFieldImp(PersistenceCapable _pc, FieldMetaData fmd, String currentValue, String newValue) +353
OpenAccessRuntime.DataObjects.PCStateMan.SetStringField(PersistenceCapable _pc, Int32 field, String currentValue, String newValue) +227
ProjectName.Data.OA.Contact.OpenAccessEnhancedSet_organization(Contact owner, String value) +97
ProjectName.Data.OA.Contact.set_Organization(String value) in c:\Projects\DotNet\ProjectName.V2
\ProjectName.Data.OA\Entities\Contact.generated.cs:88
ProjectName.Web.Controllers.AccountController.ChangePwd(LocalPasswordModel form) in c:\Projects\DotNet\ProjectName.V2\ProjectName.Web\Controllers\AccountController.cs:258
lambda_method(Closure , ControllerBase , Object[] ) +180
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9633216
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
My code is someting like below:
Contact contact = _dbContext.Contacts.FirstOrDefault(x => x.Email == uc.Session.ContactId);
contact.Organization = "test";
_contactService.Update(contact);
and it throw error on the line of contact.Organization = "test";
please help!
I got this error when I tried to update an existing record, please see below:
Server Error in '/' Application.
The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Telerik.OpenAccess.Exceptions.InvalidOperationException: The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed.
Source Error:
Line 86: set
Line 87: {
Line 88: this._organization = value;
Line 89: }
Line 90: }
Source File: c:\Projects\ProjectName\Project.Data.OA\Entities\Contact.generated.cs Line: 88
Stack Trace:
[InvalidOperationException: The update of field 'ProjectName.Data.OA.Contact._organization' is not allowed.]
Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
OpenAccessRuntime.ExceptionWrapper.Throw() +42
OpenAccessRuntime.DataObjects.PCStateMan.handleException(Exception x) +106
OpenAccessRuntime.DataObjects.PCStateMan.setStringFieldImp(PersistenceCapable _pc, FieldMetaData fmd, String currentValue, String newValue) +353
OpenAccessRuntime.DataObjects.PCStateMan.SetStringField(PersistenceCapable _pc, Int32 field, String currentValue, String newValue) +227
ProjectName.Data.OA.Contact.OpenAccessEnhancedSet_organization(Contact owner, String value) +97
ProjectName.Data.OA.Contact.set_Organization(String value) in c:\Projects\DotNet\ProjectName.V2
\ProjectName.Data.OA\Entities\Contact.generated.cs:88
ProjectName.Web.Controllers.AccountController.ChangePwd(LocalPasswordModel form) in c:\Projects\DotNet\ProjectName.V2\ProjectName.Web\Controllers\AccountController.cs:258
lambda_method(Closure , ControllerBase , Object[] ) +180
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9633216
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
My code is someting like below:
Contact contact = _dbContext.Contacts.FirstOrDefault(x => x.Email == uc.Session.ContactId);
contact.Organization = "test";
_contactService.Update(contact);
and it throw error on the line of contact.Organization = "test";
please help!