
I'm receiving a 400 (Bad Request) error when making a GET request to fetch items from a Dataverse table ( cupe_projectdetail )
webapi.safeAjax({
type: "GET",
url: "/_api/cupe_projectdetails",
contentType:"application/json",
success: function(res, status, xhr) {
// Successful response
},
error: function(err){
console.log(err);
}
});
Server Response:
{"error":{"code":"9004010D","message":"Common Data Service error occurred.","cdscode":"0x80072491","innererror":{"code":"0x80072491","message":"Entity cupe_projectdetail isn't enabled for change tracking."}}}
I believe this began to happen after I enabled and then disabled change tracking on the cupe_projectdetail table. During that process I had added the following entry to Site Settings, which is now removed:
Name: Webapi/cupe_projectdetail/ChangeTrackingEnabled
Value: True
I'm not sure what this error response means as it's not clear to me why change tracking being disabled would prevent items from being returned, and only after it was enabled in the first place. Interestingly, if the Portal is restarted, the first time the request is made it is successful and returns results. However, all subsequent requests fail.
Another, possibly relevant note, the same request but querying a specific item is successful:
webapi.safeAjax({
type: "GET",
url: "/_api/cupe_projectdetails(4d2e76d0-dc9f-ec11-a81c-000d3a5d1990)",
contentType:"application/json",
success: function(res, status, xhr) {
// Successful response
},
error: function(err){
console.log(err);
}
});
Any help in understanding where I'm going wrong would be greatly appreciated!
This issue has been resolved after following the instructions here: https://docs.microsoft.com/en-us/powerapps/maker/portals/admin/portal-checker-analysis#organization-not-enabled-for-change-tracking
Note, restarting the Portal from the Admin Center only resolved the issue for the first page load. However, after turning off the Portal entirely and then turning the Portal back on, this issue has not resurfaced.