Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
9 votes
Accepted

What is best way to delete all records from any Dev org

It would be pretty straightforward to write a minimum viable batch to clear one table at a time for this scenario: public class DeleteAllBatch implements Database.Batchable<SObject> { final ...
Adrian Larson's user avatar
  • 150k
8 votes
Accepted

Anyway to mass delete Custom Metadata Type records?

As Custom Metadata Records are metadata you can use Force.com Migration Tool and deploy the destructive changes content of destructiveChanges.xml <?xml version="1.0" encoding="UTF-8"?> <...
Oleksandr Berehovskyi's user avatar
7 votes

Deleting Cases from org

It is possible to defer sharing rule calculations, which might help if you are fairly certain sharing recalculation is the root cause. Take a look at Deferring Sharing Rule Calculations. ...
Adrian Larson's user avatar
  • 150k
7 votes
Accepted

Mass delete Debug logs using Salesforce DX

The following worked for me sfdx force:data:soql:query -q "SELECT Id FROM ApexLog" -r "csv" | out-file -encoding oem out.csv sfdx force:data:bulk:delete -s ApexLog -f out.csv With ...
Pmanglani's user avatar
  • 158
6 votes

Mass delete Debug logs using Salesforce DX

The following worked fine for me in MAC sfdx force:data:soql:query -q "SELECT Id FROM ApexLog" --resultformat csv > out.csv sfdx force:data:bulk:delete -s ApexLog -f out.csv I have not ...
Mohith Shrivastava's user avatar
6 votes

Remove users from All contacts in marketing cloud

Further to my previous answer, you can now delete Contacts using the REST API. I've just tested this and this works. Deleting Contacts is a two step process. There is documentation on this page and ...
Eliot Harper's user avatar
  • 16.6k
5 votes
Accepted

Why is the mass delete of reports function not removing reports?

If your reports are used in any Dashboards, they will fail to delete using this bulk action, but also not provide any error messages. You need to find the Dashboards containing these Reports and ...
Adrian Larson's user avatar
  • 150k
4 votes

Returning PRODUCTION Org to Virgin Status Without DEVELOPER Tools

A developer can do this efficiently with destructive changes via the Metadata API. One benefit of doing it this way is the XML file can be incrementally tested using the "Check Only" option against ...
Daniel Ballinger's user avatar
3 votes

What is best way to delete all records from any Dev org

You could use the 'Mass Delete Records' in data management. I have not actually tried out this option hence I am unaware how effective this is. Alternatively, you could keep apex script ready that ...
Prajith's user avatar
  • 1,559
3 votes
Accepted

Mass Delete Tens Of Millions Of Records

A previous organisation I worked had had a couple of child objects with over 250 million rows of data in. When the time came to delete some of it we populated a custom indexed field on the relevent ...
colin's user avatar
  • 46
3 votes

Mass Delete Picklist values

I am using a Chrome extension which lets me multi select a series of links and open as many tabs. This is done by selecting an area on the web page via right click. If you select multiple "Del" links ...
fcathala's user avatar
  • 317
3 votes

How to mass delete only one particular field value (for all records)?

Use the Salesforce Data Loader. Download Salesforce Data Loader. Authenticate to the Salesforce org that needs data to be updated. Extract the records from the object by pulling only the Id and the ...
Mohith Shrivastava's user avatar
3 votes

Delete Mass records

You can able to delete the custom object records by using Truncating feature without using apex code. If you do not see Truncate button in the custom object, go to Setup | Customize | User Interface |...
Ankaiah Bandi's user avatar
3 votes
Accepted

Queries on Large Object (>1 million rows) Fail to Execute

First, a full recycle bin can cause problems, because IsDeleted is not indexed. Consider hard-deleting records as you delete them with the emptyRecycleBin function. I suspect the Queueable is probably ...
sfdcfox's user avatar
  • 494k
3 votes

LWC Export query results to Excel/csv where rows > 2000 prior to delete

The delete all mode can just use whatever query the LWC used originally to get all the data, up to 50,000,000 rows. public Iterable<sObject> start(Database.BatchableContext context) { return ...
sfdcfox's user avatar
  • 494k
2 votes

Backup and remove old ActivityHistory entries?

Think about Activity History as just a related list with a pointer to completed tasks. The records in that object cannot be created, edited, deleted, etc because they, in essence, do not exist. The ...
Eric's user avatar
  • 54.2k
2 votes

Remove users from All contacts in marketing cloud

in the release of January 2018 Salesforce released a new feature: Link to the release note. But you have to contact your AE to enable it. If not is there a way I can clear my All Contacts list (as ...
Johannes Schapdick's user avatar
2 votes

Anyway to Delete Mass reports in SF which sit in different folders?

I have actually found a GREAT way to do this in bulk even if you don't have Eclipse. It involves building a fairly simple destructivechanges.xml file and deploying it through Workbench. First, you ...
Patrick Watkins's user avatar
2 votes

How can I bulk delete Prospects in Pardot?

I'd use a segmentation rule to place all your unwanted prospects onto a list. Then select all prospects. using 'table actions' you'd be able to delete all your desired prospects. However, you should ...
Richard Lewis's user avatar
2 votes

Trigger truncate of an object

Currently there is no way to truncate the object using apex or API. There is an idea posted which you can up-vote so that Salesforce takes this up to deliver this in future releases. One other way ...
Vijay Ganji's user avatar
  • 6,646
2 votes
Accepted

Estimated time to Delete multiple Contacts via Data Extension

I deleted 3.3 million in 3 data extensions. They got suppressed immediately and then the delete job was "cancelled" overnight. I still have an open support ticket. Looks like it's finished after ...
Adam Spriggs's user avatar
  • 30.7k
2 votes
Accepted

Automate Data Extension Deletion in Salesforce marketing cloud

There is no function inside of SSJS that will let you do this. The Core functions do not have a 'Delete' option for DataExtensions, but you CAN do this via WSProxy. You would first retrieve each of ...
Gortonington's user avatar
  • 30.6k
2 votes
Accepted

Is it possible to make a single API request which deletes multiple records using external id without creating a custom rest resource?

This is definitely possible using a simple Composite Graph API, you will need to a POST request to the below URL /services/data/v51.0/composite/graph The sample request is as below { "graphs&...
Mohith Shrivastava's user avatar
2 votes

Anyway to mass delete Custom Metadata Type records?

If you can run Apex, here's how you assemble the list for the destructiveChanges.xml very quick. Note: replace { and } by corresponding angle brackets. Copy paste the debug statements into your ...
Jaap Scheper's user avatar
2 votes
Accepted

Mass Delete AccountContact Relationship Record

This should be pretty straightforward. You just want to leave the primary account relationship as you cannot delete that (since a contact needs a parent account). Using dataloader, you can export the ...
Kris Goncalves's user avatar
2 votes

SFDMU - Deleting 30 Millions records

There is an old bug from 2017 in the jsforce plugin that fails to query more than 1m records. It's been also reported here in the sfdmu repo, with some workarounds ...
Christophe Vidal's user avatar
1 vote

Implications of deleting from All Contacts

If you delete contacts, they will be removed from your all subscribers list on the email. Depending on the evaluation before deleting, you will not be able send to anyone that is being deleted. Ex: If ...
HHF21's user avatar
  • 59
1 vote
Accepted

apex class to delete records older than 90 days

This code seems fine to me. You don't need to explicitly assign the query result, however; you can give it directly to the DML operation: delete [select id from Interaction__c ...
David Reed's user avatar
  • 93.1k
1 vote

Flow to Delete Leads doesn't seem to work as hoped

Scheduled flows execute a separate flow interview for every record that meets your entrance criteria so a loop is wholly unnecessary as you will only work with a single record in any flow interview. ...
Michelle Hansen's user avatar
1 vote
Accepted

Marketing Cloud FTP --> Automatic Delete Functionality

The custom retention periods will no longer be applicable for the customer's accounts. Marketing Cloud will retain your files on Marketing Cloud FTP for at least 21 days. Any file that exists on the ...
Abhishek Mudireddy's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible