Exam PDII Topic 3 Question 152 Discussion

Actual exam question for Salesforce's PDII exam
Question #: 152
Topic #: 3
A developer needs to implement a historical Task reporting feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the Tasks related to the Account object.
The developer must ensure the search is able to return Tasks that are between 12 and 24 months old. It should exclude any tasks which have been deleted, and include Tasks whether archived or not.
Given the following code, which select statement should be inserted at the placeholder as a valid way to retrieve the Tasks ranging from L2 to 24 months old?

Suggested Answer: C Vote an answer

To retrieve Tasks that are between 12 and 24 months old, we need to use a SOQL query that filters based on the CreatedDate. The query must exclude deleted records and include both active and archived tasks. Since Tasks can be archived after a certain period (typically 12 months), we must ensure the query includes these as well.
* Option C is correct because it uses ALL ROWS in the SOQL query, which includes both active and archived (soft-deleted) records. The query also correctly uses a range for CreatedDate to ensure it selects Tasks created between 12 to 24 months ago.
* Option A is incorrect because it does not include the ALL ROWS keyword, which is necessary to include archived Tasks in the results.
* Option B is incorrect because it only retrieves Tasks created in the last 12 months, not between 12 to 24 months ago.
* Option D is incorrect because it does not filter Tasks based on their creation date correctly to include only those that are between 12 and 24 months old.
References:
Salesforce Developer Documentation on SOQL and SOSL Reference: SOQL and SOSL Reference Salesforce Developer Documentation on Working with Archived Records: Working with Archived Records

by Hermosa at Jul 02, 2026, 05:21 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10