Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified Platform Developer II (Plat-Dev-301) Exam - Topic 7 Question 41 Discussion

A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.The test class is below:What is causing the code coverage problem?
C) The executeBatch must fail within test. startTest ( ) and -- test. stopTest().
A) The batch process will not recognize new accounts created in the same session
B) The account creation already sets the sates amount to 0.
D) The batch needs more than one account record created.

Salesforce Certified Platform Developer II (Plat-Dev-301) Exam - Topic 7 Question 41 Discussion

Actual exam question for Salesforce's Salesforce Certified Platform Developer II (Plat-Dev-301) exam
Question #: 41
Topic #: 7
[All Salesforce Certified Platform Developer II (Plat-Dev-301) Questions]

A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.

The test class is below:

What is causing the code coverage problem?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Mickie
7 months ago
The account creation setting sales amount to 0 could be the culprit too.
upvoted 0 times
...
Charlene
7 months ago
Option C sounds off to me, not sure about that.
upvoted 0 times
...
Ruth
7 months ago
Wait, does it really need more than one account to run properly?
upvoted 0 times
...
Margery
8 months ago
I agree, that's a common issue with Batch Apex.
upvoted 0 times
...
Staci
8 months ago
The batch process won't see new accounts in the same session.
upvoted 0 times
...
Annabelle
8 months ago
I wonder if the account creation setting the sales amount to 0 is affecting the logic in the batch. It seems like it could be a factor, but I need to double-check.
upvoted 0 times
...
Kattie
8 months ago
I feel like I saw a similar question where the executeBatch had to be called within test.startTest() and test.stopTest(), but I'm not entirely confident about that.
upvoted 0 times
...
Ira
8 months ago
I think the test class needs to create multiple accounts to properly test the batch, but I can't recall if that's the only requirement for coverage.
upvoted 0 times
...
Wilda
8 months ago
I remember reading that batch processes might not recognize records created in the same transaction, but I'm not sure if that's the main issue here.
upvoted 0 times
...
Jeannetta
8 months ago
Okay, I've got this. The question is asking about the key decisions that need to be made when calculating VaR, and the answer is C - confidence level/horizon, portfolio valuation method, and 1-day vs 10-day VaR. I'm feeling confident about this one.
upvoted 0 times
...
Aimee
8 months ago
I'm a bit confused about whether it should be recognized at the beginning of the year or at the change date. I might lean towards August.
upvoted 0 times
...
Clorinda
8 months ago
Typical exam trick - they're testing whether you understand standard healthcare referral protocols. I'm confident it's True.
upvoted 0 times
...

Save Cancel