function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
seshu.babu1.3923612903234636E12seshu.babu1.3923612903234636E12 

trigger to purge data

I want to delete the data I mean we do field value is null. and needs to delete the attachments in the Notes & Attachment section.
If you have any code please share.
sandeep sankhlasandeep sankhla
Hi Sesu,

You want to delete all notes and attachments related to object right ?

 
seshu.babu1.3923612903234636E12seshu.babu1.3923612903234636E12
Yes, we have to delete the attachment related objects as well. please kindly share the code.
sandeep sankhlasandeep sankhla
can you elaborate more what exactly you want to delete and when ?
seshu.babu1.3923612903234636E12seshu.babu1.3923612903234636E12
I have data that is Account status is Cancelled and based on the status and record age is 7 yrs, I have to retrieve all the records account and related objects.
There are few fields for ex: personal information fields are fielda, fieldb, fieldc etc. I want to null these fields and need to delete attachments from notes section (from related objects also. account, contact and opportunity)
please share the code like trigger.