Welcome to my blog

I have been working with Salesforce for quite a while, so don’t hesitate to contact me if you have any questions or want some advice.

s f

Subscribe
Follow Us
h

Truncate sObject records in Salesforce

 . Adminstrator  . Truncate sObject records in Salesforce

Truncate sObject records in Salesforce

Truncate sObject Record Using REST API in Salesforce Platform

Many developer’s are trying to delete whole sObject records using SOQL query like SQL  “Truncate table” but salesforce force.com platform doesn’t support that.

Truncate “Table/sObject” means logically equivalent to the Delete [Select Id From Account];.

Salesforce has option to truncate custom object records using Truncate button. By default you can’t see the Truncate button on the UI. You have to contact your administrator enable “Truncate” option.

Please follow steps to enable Truncate:-

  1. Go to Setup under your name on the right most corner.
  2. Type “User Interface” in QuickFind search box on the left.screen-shot-2016-12-21-at-11-29-07-am
  3. Click “User Interface” like and check “Enable Custom Object Truncate” flag to True.screen-shot-2016-12-21-at-11-28-38-am
  4. Click Save.
  5. Now you can see Truncate button on custom object. Once you clicked button data will be deleted from that object with in few seconds.screen-shot-2016-12-21-at-11-29-38-am
How data deleted from Salesforce in few seconds?
Once you clicked Truncate button - creating new table with same structure and renaming old table into "TableName_trunc".

Note: if you are not able to Truncate button on the custom object then check is there any custom indexed field exists then please create salesforce support case to remove fields custom index for that object.

Data storage not going to increase once you clicked Truncate button it will take 15 days to remove from your org. If you want to remove immediately then you need to create another salesforce support case.

Post a Comment