function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Newbie  2014Newbie 2014 

"isDeleted" field not marked as TRUE upon standard object record deletion

Hello: Our organization needs to track the deleted records for the standard objects in salesforce for some reason and we have been relying on the ‘isDeleted’ field for the info. Deleted records are supposed to be kept in place for 15 days with that flag turned on! But we came to notice that the “opportunity product” and “accountcontactrole” tables are removing the deleted records right away instead. I am sure some other tables behaving same way.
To simulate the situation, we added a new accountcontactrole via Salesforce frontend. Then pulled the table via excel connector to verify the new record is in place. Right after we hit the ‘del’ button on the ‘contact role’ section for that record to delete our new entry. As the last step, we exported the entire table from salesforce but did NOT find any trace of that newly created record with isDeleted=true. This proves that salesforce is not keeping the deleted ‘account contact role’ records in the table with isDeleted=true for 15 days until it is permanently taken off!

Please provide me with some insights re: the discovery if you know what’s going on here. Thank you very much
Best Answer chosen by Newbie 2014
kevin lamkevin lam
You can do this in Apex with something like:

Boolean undeletable = AccountContactRole.SObjectType.getDescribe().isUndeletable();

The information is also in the SOAP API Developer's Guide.

All Answers

kevin lamkevin lam
Not all objects go to the recycle bin when deleted, you need to check the Undeletable attribute of that object.
Newbie  2014Newbie 2014
Thanks very much for the insight Kevin.

Question to Kevin or anyone else who might be able to help: I need to check the 'undeletable' attribute for two child tables: accountcontactrole and opportunity product, but not sure how to do that via any interface. Googled and searched forums, but does not seem like i can do with w/o any API calls etc. Is that the only way? If yes, then would appreciate some C# coding to do that. I hope a sys admin for our CRM will have permission to do so right?
kevin lamkevin lam
You can do this in Apex with something like:

Boolean undeletable = AccountContactRole.SObjectType.getDescribe().isUndeletable();

The information is also in the SOAP API Developer's Guide.
This was selected as the best answer
Newbie  2014Newbie 2014
thanks very much again
Shefali Gupta 6Shefali Gupta 6
Hi there, 

I am also looking for "isDeleted field not marked as TRUE upon standard object record deletion" in my case for SkillUser object. Can anyone please provide more insight on this?

Thank you, 
Shefali