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
szesze20szesze20 

Best Practice when deleting custom objects

Our org is cleaning up some old objects. What is the best practice? I have 2 questions:
  1. Some dependencies I can think of are: Identifying dependencies such as Workflows or formula fields using these objects? Any other dependencies we should consider?
  2. Rather than manual, is there a way to search/export from eclipse, workbench for all workflows, formula fields that use these objects? 
  3. Whats the best way to mass-query date of last record created/modified for each of these old objects using API names? thanks.
Best Answer chosen by szesze20
Fahad-AkhtarFahad-Akhtar
Hi szesze20,
Check what was last object records where modified and what part of application is using it, Use "Zzz" as part of deprecation policy and leave that object there for some time in case some business processes and applications are using it unintentionally
As part of deprecation policy, check followings:

Check order in which you need to delete object, any child object dependencies e.g.formula field.
Roll up summary fields
Workflow
Validation rule
Email templates
Trigger
VF pages
Controllers

Use IDE/ANT to download all metadata and use search metadata for references.
Before you delete, make sure you take all data backup using data export feature.
Always a good idea to backup metadata as well.
SELECT id,lastmodifiedDate  FROM Case ORDER by lastmodifiedDate DESC LIMIT 1

Thanks,
Fahad Akhtar