function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ritika SinghRitika Singh 

PD1 preparation - Please provide your valuable response for below PD1 questions.


1. Which governor limit applies to all the code in an Apex transaction?

A. Elapsed SOQL query time
B. Number of classes called
C. Number of new records created
D. Elapsed CPU time

2. A developer wants multiple test classes to use the same set of test data?
How should the developer create the test data ?

A.Reference a test utility class in each test class
B. Create a test setup method for each test class
C. Define variables for test records in each test class
D. Use SeeAllData = true annotation in each test class

3. A developer needs to apply the look and feel of lightning experience to a number of applications built using a custom third-party JavaScript framework and rendered in visualforce pages.
Which option can achieves this? 

A. Set the attribute enablelightning to "true" in the definition
B. Replace the third-party JavaScript library with native visualforce tags
C. Configure the user interface options in the setup menu to enable legacy mode for visualforce
D. Incorporate salesforce lightning design system CSS stylesheets into the JavaScript applications

4. What is considered the primary purpose for creating apex tests?
A. To guarantee at least 50% of code is covered by unit tests before it is deployed
B. To ensure every usecase of the application is covered by a test
C. To confirm every trigger is executed at leat once.
D. To confirm all classes and triggers compile successfully

5. Which declarative method helps to ensure quality data?

A. Workflow alerts
B. Page layouts
C. Lookup filters
D. Validation rules
E. Exception handling

6. A developer creates an Apex helper class to handle complex trigger logic. How can the helper class warn users when the trigger exceeds DML governor limits?
A. By using ApexMessage.Message() to display an error message after the number of DML statements is excel
B. By using Messaging.SendEmail() to conthtinue the transaction and send an alert to the user after the number DML statements is exceeded.
C. By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number DML statements is exceeded.
D. By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded. 

-- Which solution is correct A or D ?

7. A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which statement is unnecessary inside the unit test for the custom controller?
a.    Test.setCurrentPage(pageRef);
b.    String nextPage = controller.save().getUrl();
c.    ApexPages.currentPage().getParameters().put(‘input’, ‘testValue’);
d.    Public ExtendedController(ApexPages.StandardController cntrl) {}
Nitin ShyamnaniNitin Shyamnani

Q1: D. Elapsed CPU time

Q2 A.Reference a test utility class in each test class

Q3 D. Incorporate salesforce lightning design system CSS stylesheets into the JavaScript applications

Q4 B. To ensure every usecase of the application is covered by a test

Q5 B. Page layouts
C. Lookup filters
D. Validation rules

Q6  D) By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded.

Q7  b.    String nextPage = controller.save().getUrl();

Ritika SinghRitika Singh
Hi Nitin,

Thanks for your responses !
Below are my answers and I have doubt with below three questions :
Q5 - A. Workflow alerts ; C. Lookup filters ; D. Validation rules -   Are A, C, D incorrect ? If yes then how ?
Q6 -  A. By using ApexMessage.Message() to display an error message after the number of DML statements is excel - is this incorrect ? If yes then how ?
Q7 -  D.  Public ExtendedController(ApexPages.StandardController cntrl) {} - is this incorrect ? If yes then how ?

And few more questions if you/someone can help with ? (Assumption for answers have been marked ). Please let me know the correct answers for below questions.

8.  Which requirement needs to be implemented by using standard workflow instead of Process Builder? Choose 2 answers.
            A.Create activities at multiple intervals.  
            B. Send an outbound message without Apex code. 

            C. Copy an account address to its contacts.
            D. Submit a contract for approval.

9.  On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL?
             A. Use the constructor method for the controller.   
             B. Use the $Action.View method in the Visualforce page.
             C. Create a new PageReference object with the Id.
             D. Use the <apex:detail> tag in the Visualforce page.

10. In the Lightning component Framework, Which resource can be used to fire events?  Choose 2 events
              A.Visualforce Controller Actions.
              B. Third-Party web service code    
              C. Third-Party javascript Code.   
              D. Javascript controller Actions


11. An sObject named Application c has a lookup relationship to another sObject name Position c.
Both Application c and Position  c have a picklist field named Status  c. When the Status c field on Position C is updated, the Status c field on Application c needs to be populated automatically with the same value, and execute a workflow rule on Application c.

How can a developer accomplish this?
A.    By configuring a cross-object field update with a workflow.
B.    By changing Application c.Status c into a formula field.
C.    By changing Application c.Status c into a roll-up summary field.
D.    By using an Apex trigger with a DML operation.

12. Which two queries can a developer use in a visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

A.String qryName = ‘%’ + String.escapeSingleQuotes(name) + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE \ ' % ' + qryName + ' % \ ' ';
List<contact> queryResult =Database.query(queryString);


B. String qryName = ‘%’ + name + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE :qryName' ;
List<contact> queryResult =Database.query(queryString);

C. String qryString = ‘SELECT ID FROM contact WHERE name LIKE \ ‘%’ + name + ‘%\ ’ ’;
List<contact> queryResult =Database.query(queryString);


D. String qryName = ‘%’ + String.enforceSecurityChecks(name) + ‘%’;
String qryString = ‘SELECT ID FROM contact WHERE name LIKE :qryName;
 -- What is the solution  (A & B) or (A & C) ?

13.  A developer needs to create an audit trail for records that are sent to the recycle bin. Which type of trigger is most appropriate to create?

   A. after undelete
   B. before delete
   C. after delete
   D. before undelete