Delete the demo/sample data from the trial phase out of your ORG

Once your ORG is active and you are working with your own data, you can delete all of the Propertybase demo data with just a few clicks!

Open the Developer Console:

In the "Debug" menu select "Open Execute Anonymous Windows":

Copy this code here and paste it to the new text box. Then press "Execute":

Organization org = [SELECT CreatedDate FROM Organization];
Datetime creationDateMin = org.CreatedDate;
Datetime creationDateMax = org.CreatedDate.addMinutes(2);

for (SObjectType t : Schema.getGlobalDescribe().values()) {
String objName = t.getDescribe().getName();
if (t == pba__Request__c.SObjectType
|| t == pba__Listing__c.SObjectType
|| t == pba__Property__c.SObjectType
|| t == pba__Offer__c.SObjectType
|| t == Contact.SObjectType
|| t == Account.SObjectType
) {
List<SObject> sObjs = Database.query('Select Id from ' + objName +
' Where CreatedDate >= :creationDateMin AND CreatedDate < :creationDateMax');
delete sObjs;
}
}

You can find the deleted records in the recycle bin. :-)

Another alternate way you can do this is through Workbench.

the https://workbench.developerforce.com/login.php

1. Login to Production

2. Jump to Apex Execute > Select

3. Copy the code from above > Execute 

Finished

Powered by Zendesk