locked
Geting this error when updating the entity from c# "an unexcepted error occurred " RRS feed

  • Question

  • I'm  getting this error when trying to update isemri Entity. I tryed to deleting first 2 row and update the isemri Entity it worked with  this row isemri["new_tamamlayanbayikullanicisi"] = new EntityReference("lead", leadId); but first 2 row doesnt work for entity. 

                        1-   isemri["new_vehiclebrand2"] =  new EntityReference("new_vehiclebrand",(Guid) task.Brand.Value);
                        2-  isemri["new_vehiclemodel2"] = new EntityReference("new_vehiclemodel", task.Model.Value);
                            isemri["new_vehicleyear"] =  task.VehicleYear;
                            isemri["new_tamamlayanbayikullanicisi"] = new EntityReference("lead", leadId);
                            isemri.Id = gorev.new_isemriId;

                           service.Update(isemri);

    here is my error stackTrace 

    Name Value Type
    StackTrace "\r\nServer stack trace: \r\n at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Update(Entity entity)\r\n at CRMAccountApi.Business.MobileTaskBusiness.CompleteSensorTask(TaskModel task, Guid leadId)\r\n at CRMAccountApi.Business.MobileTaskBusiness.CompleteTask(TaskModel task, Guid leadId)\r\n at CRMAccountApi.Controllers.MobileTaskController.SubmitTask(TaskModel task)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)" string

                           
    Monday, November 16, 2020 10:41 AM