query on deleted CaseMilestone records with fields: TimeRemainingInMins, TimeSinceTargetInMins will fail with "entity is deleted"
Last updated 2018-06-09 ·Reference W-4606388 ·Reported By 2 users
If you perform an "include deleted records" soql query on the CaseMilestone record with the fields TimeRemainingInMins and TimeSinceTargetInMins being part of the query, when the parent case is hard-deleted the error: "entity is deleted" will be returned and you will not retrieve the records
Create a Case and CaseMilestone record.
Soft-delete the Case, which will then soft-delete the CaseMilestone.
Hard-delete the case.
Try the query: select id, TimeRemainingInMins , TimeSinceTargetInMins from CaseMilestone while including deleted records using workbench or dataloader.
Error will be returned
1. Adding another filter to exclude all deleted records, "isDeleted=false".
2. Query only Id field from CaseMilestone entity. queryResult1 exclude deleted records and queryResult2 include deleted records. Compare the Id, then query CaseMilestone with Id as filer, this way we could extract all fields without any errors.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.