Activity Forums Salesforce® Discussions Problem in batch class in salesforce

  • Problem in batch class in salesforce

    Posted by Deepak on September 20, 2019 at 1:28 PM

    I am writing a test class of batch class it code coverage is 80% but my execute part is not covered. Is it necessary to cover execute part?

    Nikita replied 6 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Nikita

    Member
    September 23, 2019 at 6:48 AM

     

    Hi Deepak,

    Yes, it is necessary to cover the execute method of a batch class in the test class. If start is returning a batch ( which is rows returned by the query locator) then only it will go in the execute method.

Log In to reply.

Popular Salesforce Blogs

The Intelligent Commerce Stack: How Salesforce is Powering the Next Generation of Online Retail

Blog in

Online retail faces growing challenges: managing complex operations, integrating multiple sales channels, and delivering personalized, consistent experiences across B2C and B2B segments. Traditional commerce systems…

Popular Salesforce Videos