What will be the output ?

What will be the output ?

Assume we have one Trigger defined on Case Object in Salesforce. Trigger code will look like below.

trigger CaseTrigger on Case (before insert) {

    System.debug('What will be the output');

}

Now we are going to insert 598 case Record through below code through execute Anonymous window in the developer console.

List<Case> caseList= new List<Case>();

for(Integer i=0 ; i<598 ;i++){

Case caseObj = new Case( Status = 'Working',Origin = 'Phone');

caseList.add(caseObj);

}

insert caseList;

Now can you help us to find out how many times What will be the output

will print in console log ?


Please don't execute in ORG and write the output here. :P

Viren Sa

Founder, CEO @ Implado

7 年

Hi Nishant Prajapati Congrats...you have won prize money for your answer. Inbox me your Mobile number...Award money will be credited to the same Mobile Number 2$ Only as question also not that much tuff :)

回复
Nishant Prajapati

Technical Lead | 4x Certified Salesforce Developer | APEX | Visualforce | JavaScript | Aura | LWC | Integration

7 年

The result will display -: What will be the output What will be the output What will be the output 3 times, Because Triggers execute on batches of 200 records at a time.So, So if 598 records cause a trigger to fire, the trigger fires 3 times, once for each 200 records.

回复

要查看或添加评论,请登录

Viren Sa的更多文章

  • Sometimes Age and Certification count comes alone !

    Sometimes Age and Certification count comes alone !

    Here are few things which I should ask to myself ? 1. Do I judge maturity level of person with his/her Age ? 2.

    1 条评论
  • Outcome is same but journey experience matters !

    Outcome is same but journey experience matters !

    “Success is a journey, not a destination. The doing is often more important than the outcome.

    1 条评论
  • WORA : Write Once Use Everywhere

    WORA : Write Once Use Everywhere

    Hello Bhaiyo and Bhano, Ladies and Gentleman, Boys and Girls. I hope you have heard about this phrase Necessity is the…

    1 条评论
  • ApexGuru OR ApexLearner Quiz 2

    ApexGuru OR ApexLearner Quiz 2

    Unpredictability means what it means. I don't know how you define it.

    3 条评论
  • ApexGuru or ApexLearner Quiz 1

    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…

    7 条评论
  • How much difficult to learn Salesforce ( Admin Role)

    How much difficult to learn Salesforce ( Admin Role)

    **NO TECHNICAL BACKGROUND REQUIRES TO LEARN SALESFORCE ADMIN :) Before to understand how much difficult to learn…

    4 条评论
  • ForceFunda has been launched

    ForceFunda has been launched

    Key to unlock excellence in Salesforce for a beginner as a duck takes to water. Introduction video is here.

社区洞察

其他会员也浏览了