You need to sign in to do that
Don't have an account?

Hard Delete Records Options ?
What different ways can we hard delete salesforce records.
1. From within Apex (batch) ?
2. Bulk API (Java) ?
3. Data loader - Hard Delete options ? Tried this, working fine.
Out requirements is to have a batch running every X minutes (inside/outide of SF) which can query records and hard delete them.
-Sid
1. From within Apex (batch) ?
2. Bulk API (Java) ?
3. Data loader - Hard Delete options ? Tried this, working fine.
Out requirements is to have a batch running every X minutes (inside/outide of SF) which can query records and hard delete them.
-Sid
1. Delete your record using Standard DML for delete:
Database.DeleteResult[] delete(SObject[] recordsToDelete, Boolean opt_allOrNone)
2. Empty recycle bin for the records you have just deleted using :
Database.EmptyRecycleBinResult[] emptyRecycleBin(ID [] recordIds)
API
1. Delete your record using Standard DML for delete:
DeleteResult[] = connection.delete(ID[] ids);
2. Empty recycle bin for the records you have just deleted using :
EmptyRecycleBinResult[] = connection.emptyRecycleBin(ID[] ids);
Best options in CRM is to
1.create a batch class.
2.apply your business logic(Hard Delete).
3.Create schedule class.
Yes Sidharth...we donot have any direct DML operation in apex for hard delete.We should first delete the records and then empty recycle bin.
Please go through the link https://help.salesforce.com/articleView?id=000135460&type=1