Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have a development org with a quite complex object structure and a ton of demo data. To refactor thr structure I want to get rid of all this data.

My first thought was to use the new "Truncate" button on objects, but that would mean I would have to delete child records first. For a structure like this this is not something you just calculate in 5min.

Is there another way to do this? I also tried the "Delete All Data" but that gave up as my org has too much data.

share|improve this question
1  
Truncate button does not show up in 4 cases: (1) Are referenced by another object through a lookup field or that are on the master side of a master-detail relationship (2) Are referenced in an analytic snapshot (3) Contain a geolocation custom field (4) Have a custom index or an external ID. See this: salesforce.stackexchange.com/questions/7348/… –  Suman Krishna Saha Feb 18 '13 at 17:12

1 Answer 1

Since you are talking about a Development Org, I would first recommend just creating a new one since they are free; otherwise I would script out the truncate calls, object by object. This would simplify your task and provide automation for the future.

Update

I'm not sure if you can programmatically determine your dependencies, so I would handle that by visual inspection of the schema. As for examples on how to handle the bulk deletes, I would expect using the Data Loader to be the quickest method since it already handles the batching for you and can be called from the command line. You can refer to the Data Loader Guide for examples.

share|improve this answer
    
I can't just create a new org but I like the script option. Is there any example around on how to do this. I guess I would need Batch Apex for the deletion and some kind of dependency sort for the deletion order?! –  Robert Sösemann Feb 18 '13 at 14:33
1  
I found out that you indeed can determine this with code by doing a topographic sort on the dependency graph. I am currently trying to put that into a helper class. –  Robert Sösemann Feb 19 '13 at 13:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.