最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Dynamics AX 365不允许插入字段’XXXX’“,”type“:”System.InvalidOperationException“ / Dynamics AX 365 insert not allowed for field ‘XXXX’“,”type“:”System.InvalidOperationException“

网络文摘 William 238浏览 0评论
I was working on creating the new Data entity related to Case Details on Dynamics ax 365, The creation went well and simple. when i tried to consume the new Data entity from odata client using c#, i got this exception. An error occurred while processing this request.{ “error”:{ “code”:””,”message”:”An error has occurred.”,”innererror”:{ “message”:”insert not allowed for field ‘CaseId'”,”type”:”System.InvalidOp erationException”,”stacktrace”:” at Microsoft.Dynamics.Platform.Integration.Se rvices.OData.Update.UpdateProcessor.CreateEntity_Save(ChangeOperationContext con text, ChangeInfo changeInfo)\r\n at Microsoft.Dynamics.Platform.Integration.Se rvices.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 acti onList, ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Pla tform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContex t operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OD ata.Update.UpdateManager.SaveChanges()\r\n at Microsoft.Dynamics.Platform.Inte gration.Services.OData.AxODataBatchHandler.<ExecuteRequestMessagesAsync>d__10.Mo veNext()” } } } This error is related to CaseId field on Case Details, after enough investigation i found that validatefield method from corresponding table is being fired and not allowing manual insertion on CaseId field. As this field is Number sequence bound. But our requirement was to create the case using custom value provided from Odata client using c#. After enough research i got the clue to skip the table level validation from data entity. So i have decided to modify the data entity and override following methods and skip the table level validation for the CaseId field. Thanks Amir- Happy daxing ?
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址