+ Start a Discussion
Redmanx03Redmanx03 

Truncate Custom Object prior to inserting new record

Has anyone had experience with this? Wondering if i can force a trigger to Truncate a custom object prior to inserting new records. 

sfdcfoxsfdcfox

How many records would be there? If it's a small number, you could delete them in the trigger directly. For a large number, you could kick off a batch class to delete all records with a LastModifiedDate value less than the value of the trigger's starting execution time (give or take a couple milliseconds).

Redmanx03Redmanx03
large number of records.