I am working with D365FO Odata Services and EngineeringChangeManagement. One of my tasks is to provide a request for attaching documents to products attached to an ECO header. From the Odata Metadata, I already saw that there is an Entity for those documents: EngineeringChangeOrderProductDocuments
{
"dataAreaId": "demf",
"EngineeringChangeOrderProductLineNumber": 1,
"EngineeringChangeOrderNumber": "RestEco",
"DocumentId": "{Some-Document-ID-I-got-from-DocuRef-table}"
}
"error": {
"code": "",
"message": "An error has occurred.",
"innererror": {
"message": "Write failed for table row of type 'EngChgEngineeringChangeOrderProductDocumentEntity'. Infolog: Warning: Matching record for the read only data source 'DocuRef' does not exist.",
"type": "Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataWriteException",
"stacktrace": " at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.CreateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__2.MoveNext()"
}
}
}
Plus, as a more general thing I am not completly sure how Documents should be loaded to the system using Odata at all. Do I need to fill DocuRef, DocuValue and DocuHistory for that by using Custom Services or is there another way?
Thanks for helping!