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
ran67ran67 

Record Deletion in s3 using the data loader

Hi

I  have written a controller and visualforcepage to delete the records from s3amazon.

and i have  been override the standard button  delete with my visualforcePage.and its working fine when click on delete.

I am able to delete the record in salesforce as well asin S3.when i click on override button.

But  when i delete the records using the dataloader.

I am able to delete the record in salesforce but not in S3amazon...........Please help me to solve the issues

 

 

 

thanks in advances

RustanRustan

When you delete through a dataloader, the controller is not accessed. You need to create a trigger so that when you delete through a dataloader, the apex code is executed.

ran67ran67

To delete the record in s3 we need to call both the visualforcepage and controller............actually we no need of any trigger.but i want to delete the records using the dataloader

RustanRustan

To delete the records in S3 when you use a data loader, you will need to create a trigger. A dataloader does not access controllers.

 

What I suggest is by taking out the delete functions in S3 in the controller and creating an after delete trigger. When you do this, if you delete using a dataloader or through a visualforce page, it will delete the record in S3 as well.

 

 

ran67ran67

cn u suggest me how to write a trigger to delete the  file in s3 so i can write.................

thanks in advance

RustanRustan

Something like this...

 

 

trigger Test_Trigger on Object__c (after delete) {

 

if(trigger.isDelete)

{

 

List<id> deleteIDs = new List<id>();


for (Object__c object : Trigger.old) {
deleteIDs.add(object.id);
}

 

//here write the code for deleting all the S3 records by using the ids in the list....

 

}
}