Salesforce Developer Tutorial - How to Mass Delete Records using Apex

Salesforce Developer Tutorial - How to Mass Delete Records using Apex

Coding With The Force

9 месяцев назад

2,315 Просмотров

DISCLAIMER: Make sure prior to deleting records in your Salesforce org that this is your employers desired end state for these records, and that they wouldn't prefer to archive/offload them to another system!

In this episode we go over the best ways to mass delete records in Salesforce using both a batch job and a queueable and why you might use one over the other.

Please consider donating to help continue to improve the content produced for Coding With The Force: https://www.paypal.com/donate?business=RNHEF8ZWKKLDG&currency_code=USD

Get Coding With The Force Merch Here: https://my-store-d20559.creator-spring.com/

Follow all of our social media here:

Patreon: https://www.patreon.com/CodingWithTheForce
Github: https://github.com/Coding-With-The-Force
Facebook: https://www.facebook.com/codingwiththeforce/
Twitter: https://twitter.com/Coding_Force
Instagram: https://www.instagram.com/codingwiththeforce/

Salesforce development books I recommend:

Advanced Apex Programming: https://amzn.to/3lXi8to
Salesforce Lightning Platform Enterprise Architecture: https://amzn.to/2R0D4BQ
Mastering Salesforce DevOps: https://amzn.to/3lTtTRN

Good Non-SF Specific Development Books:

Clean Code: https://amzn.to/35PuMDU
Clean Architecture: https://amzn.to/35FYo6A

-----------------------------------------------------------------------------------------------------------------------

Table of Contents:

0:00 - Intro/Thank You
0:35 - Episode Intro
2:32 - Example Record Deletion Using a Batch Class
8:00 - Testing the batch class record deletion
12:02 - Pros and Cons of Batch Apex
13:23 - Example record deletion using Queueable Class
20:28 - Testing the queueable class record deletion
24:34 - Outro

DISCLAIMER: The views and ideas expressed on this YouTube channel and blog are based on past development experiences and may not always work for your particular scenarios. The advice in these videos may also become outdated as technology advances. They should be used as examples for educational purposes only. Using any shown solutions in your own org is not advisable since they are example scenarios.

#salesforce #salesforcedeveloper #salesforceadmin

Тэги:

#Salesforce #Development #Developer #Salesforce_Developer #Admin #Salesforce_Admin #Lightning #Training #Tutorial #Object_Oriented_Programming #OOP #Object_Oriented_Development #Illuminated_Cloud_2 #IC2 #IntelliJ #salesforce_tutorial #salesforce_mass_delete #salesforce_development #Queueable #Batch
Ссылки и html тэги не поддерживаются


Комментарии:

@CodingWithTheForce
@CodingWithTheForce - 07.09.2023 17:18

Make sure prior to mass deleting records that this is your employers desired end state for these records, and that they wouldn't prefer to archive/offload them to another system!

Ответить
@ibbiesantaloci2683
@ibbiesantaloci2683 - 30.09.2023 12:24

☹️ PromoSM

Ответить
@cassioorsi
@cassioorsi - 22.09.2023 23:53

Good stuff.
I got kinda confused when you queried for the records and then deleted them.
I thought the enqueue afterwards wouldn't work because in my head the list of cases would be empty after they got deleted.
But in reality the original list in memory still holds the copies of the records.

Ответить
@IlaNaveen
@IlaNaveen - 16.09.2023 14:29

We can also use flows to delete the records.

Ответить
@robinkorver7756
@robinkorver7756 - 11.09.2023 00:34

Any suggestions on how to handle any related records that also need deleting? (In a composable/scalable way, hopefully preventing hardcoding)

Ответить
@pedroprada1
@pedroprada1 - 07.09.2023 20:20

great video.. you are a natural... thank you!

Ответить