Used this article as reference:
docs.microsoft.com/.../use-change-tracking-synchronize-data-external-systems
Tried this implementation in C# (fragment shown here):
.......
string d365Entity = _D365BaseAddress + "data/Projects?cross-company=true&$select=ProjectID,ProjectName";
var request = new HttpRequestMessage(HttpMethod.Get, Uri.EscapeUriString(string.Format(d365Entity)));
request.Headers.Add("Prefer", "odata.track-changes");
httpClient.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
httpClient.DefaultRequestHeaders.Add("OData-Version", "4.0");
HttpResponseMessage response = await httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
string jsonResult = await response.Content.ReadAsStringAsync();
}
...........
Got this jsonResult back, which is not what I expected:
{
"@odata.context": "https://??????.sandbox.operations.dynamics.com/data/$metadata#Projects(ProjectID,ProjectName)",
"value": [
{
"@odata.etag": "W/\"JzEwOTU0ODc0MjIsNTYzNzxxxxxxxxxx\"",
"ProjectID": "101-0000XX",
"ProjectName": "Important project"
},
{
"@odata.etag": "W/\"Jzc2MjUxNzE5Miw1NjM3xxxxxxxxxxx\"",
"ProjectID": "101-000011-YY",
"ProjectName": "Not so important"
}
]
}
Questions:
- Is Prefer: odata.track-changes supported by D365?
- If so, what am I doing wrong?
/EirikS