Asynchronous Apex - Batch Jobs - Explained | Chapter 99 | Salesforce Developer Masterclass

  Рет қаралды 432

Salesforce Makes Sense

Salesforce Makes Sense

Күн бұрын

Пікірлер: 10
@salesforcemakessense
@salesforcemakessense 20 күн бұрын
Code Snippet: public class BatchForOpportunities implements Database.Batchable, Database.AllowsCallouts, Database.Stateful { public Integer count = 0; public Database.QueryLocator start(Database.BatchableContext context){ System.debug('Start Method called'); String baseQuery = 'SELECT Id, Name, StageName FROM Opportunity '; String filterQuery = 'WHERE StageName = \'Perception Analysis\' AND CloseDate < LAST_N_DAYS:7'; String finalQuery = baseQuery + filterQuery; return Database.getQueryLocator(finalQuery); } public void execute(Database.BatchableContext context, List scope){ //do all the hard work here for(Opportunity opp : scope){ count++; System.debug(count); } } public void finish(Database.BatchableContext context){ //post processing logic here System.debug('Finish method called' + count); } }
@haribabuk5162
@haribabuk5162 20 күн бұрын
Batch Job makes Sense
@salesforcemakessense
@salesforcemakessense 20 күн бұрын
Yay!
@sumitB-h8t
@sumitB-h8t 20 күн бұрын
YES we are on the RIGHT TRACK..☺😅
@salesforcemakessense
@salesforcemakessense 20 күн бұрын
Awesome!
@ravigrover1923
@ravigrover1923 20 күн бұрын
Start Method ran once Execute 10 times FInish also ran once
@salesforcemakessense
@salesforcemakessense 20 күн бұрын
That's right.
@thesalesforceseeker
@thesalesforceseeker 21 күн бұрын
what about database.iterable ?
@salesforcemakessense
@salesforcemakessense 20 күн бұрын
Iterables work similar to QueryLocator, just that there's no upper limit to the number of records that can be queried via an Iterator. However, CPU time limit does have an upper limit. But most of the times, queryLocator works fine and you can get used to it without doubt.
Apex Best Practices | Chapter 101 |  Salesforce Developer Masterclass
25:17
Salesforce Makes Sense
Рет қаралды 151
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 62 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Future method in Salesforce - Asynchronous Apex Part 1
15:56
Salesforce Exclusive
Рет қаралды 76 М.
Debug Logs - Explained | Chapter 92 |  Salesforce Developer Masterclass
36:20
Salesforce Makes Sense
Рет қаралды 1,8 М.
Salesforce Batch Apex Interview Questions
9:38
SFDC Ninja
Рет қаралды 8 М.
Batch Apex in Salesforce
17:55
Salesforce Apex Hours
Рет қаралды 3,4 М.
Was I Wrong About Blazor? | Coding Shorts 111
16:35
Shawn Wildermuth
Рет қаралды 27 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 109 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 62 МЛН