1

I have a custom object, one of the field in it is email, all the values saved in this email field got corrupted. Not all the records are having email value. Irrespective of that, I have to clear/empty entire email field values for all records. What is the best approach for doing this. TIA. NOTE: My problem is not mass deleting entire records(Only 1 particular field of all records)

2 Answers 2

3

Use the Salesforce Data Loader.

  1. Download Salesforce Data Loader.
  2. Authenticate to the Salesforce org that needs data to be updated.
  3. Extract the records from the object by pulling only the Id and the Email fields.
  4. Empty or Null the values in the Email column and make sure the Insert NULL values settings are turned on as documented.
  5. Upload the Data using the "UPDATE" operation.

MASS DELETE ONE PARTICULAR FIELD VALUE FOR ALL RECORDS = UPDATE ONE FIELD (OR COLUMN) FOR ALL RECORDS

2
1

Alternatively a batch class can be written that will query all records that are having value in Email field. Iterate over all the records and set the value to blank and update the list as required.

Downside of this approach is to have the test class as well and this involved deployment in production and then post completion of operation batch class needs to be deleted.

This approach is effective only when the data is size is very large, running in millions. Otherwise data loader approach is more effective in my view.

Generally for all such scenario I always create and push the batch class that updates the any field of any object basis the criteria defined.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .