ApexGuru or ApexLearner Quiz 1
Can you please help us to find out what will be the correct output on console log for below code snippet as for us this code snippet looks like above image :)
Integer apexGuru = 0;
Integer apexLearner = 0;
List<Case> caseList = new List<Case>();
for(Integer i = 0 ; i < 312 ; i++){
Case cs = new Case(Status='New');
caseList.add(cs);
}
insert caseList;
for(Case csGuru : [Select id,Status from Case where Status = 'New'] ){
apexGuru++;
}
for(List<Case> csChela : [Select id,Status from Case where Status = 'New'] ){
apexLearner++;
}
System.debug('ApexGuru got score as :' + apexGuru);
System.debug('ApexLearner got score as :' + apexLearner);
Let's see who can predict the output. Let us know the output in the comment section without giving facts so everyone can participate with his or her own efforts.
Note ** Please don't execute this code in ORG and paste the output here.
#HappyLearning #FoodForAll #SalesforceOhana #TheoryOfZero
??Full Stack Engineer | ??Tech Enthusiast with Expertise in JavaScript, React, Angular, and Node.js | Delivering Innovative Solutions ?? | Let's Build Exceptional Web Experiences!?
7 年ApexGuru got score as :312 ApexLearner got score as:2
Salesforce 9x Certified | Application Architect | Einstein Analytics and Discovery | Service Cloud | Platform Developer-2 | Servicemax | FSL
7 年The code will give error at below line: for(List<Case> csChela : [Select id,Status from Case where Status = 'New'] ){
11x - Certified Salesforce Engineer
7 年ApexGuru - 321 ApexLearner - 2 For every bulk operation in Salesforce work default size I.e 200. whether it is batch size, default soql records or trigger records. so here in 2nd for loop records comes in size of 200 each.
Technical Lead | 4x Certified Salesforce Developer | APEX | Visualforce | JavaScript | Aura | LWC | Integration
7 年ApexGuru got score as :312 ApexLearner got score as :2