PD1 Set2
PD1 Set2
A developer is writing tests for a class and needs to insert records to validate
functionality,
Which annotation method should be used to create records for every method in
the test class?
A. @TestSetup
B. @isTest(SeeAllData=true)
C. @startTest
D. @preTest
Ans - A
-----------------------------------------------------------------------------------
--------------
2. Universal Containers wants to back up all of the data and attachments in its
Salesforce org once a month
Which approach should a developer use to meet this requirement
A. Schedule a report
B. Define a Data Export scheduled job.
C. create a schedulable Apex class
D.Use the Data Soader command line
Ans - B
-----------------------------------------------------------------------------------
-------------
3. Which two statements accurately represent the MVC framework implementation in
Salesforce?
Choose 2 answers
A. Records created or updated by triggers represent the Model (M) part of the MVC
framework
B. Validation rules enforce business rules and represent the Controller (C) part of
the MVC framework
c. Standard and Custom objects used in the app schema represent the View (V) part
of the MVC framework.
D. Lightning component HTML files represent the Model (M) part of the MVC framework
Ans- A,B
-----------------------------------------------------------------------------------
-----------------
4. Universal Containers has a large number of custom applications that were built
using a third-party JavaScript framework and exposed using Visualforce pages.
The company wants to update these applications to apply styling that resembles the
look and feel of Lightning Experience
What should the developer do to fulfill the business request in the quickest and
most effective manner?
A. Incorporate the Salesforce Lightning Design System CSS stylesheet into the
JavaScript applications.
B. Enable Available for Lightning Experience, Lightning Communities, and the mobile
app on Visualforce pages used by the custom application
C. Set the attribute enablelightning to true in the definition
D. Rounteil Viscalforce pages as Lightning components
Ans - A
-----------------------------------------------------------------------------------
-------------------
5.Which process automation should be used to send an outbound message without using
Apex code?
A. Workflow Rule
B. Process Builder
C. Flow Builder
D. Strategy Builder
Ans - A
-----------------------------------------------------------------------------------
-------------
6. What does the lightning Component framework provide to developers?
A. Support for Classic and Lightning Uls
B. Templates to create custom components
C. Prebuilt components that can be reused
D. Extended povemor limits for applications
Ans- D
------------------------------------------------------------------------------
7. What are two benefits of using declarative customizations over code?
Choose 2 answers
A. Declarative eustomizations automatically update with each Salesforce release
B. Declarative customizations cannot generate run time errors.
C.: Declarative customizations automatically generate test dasses.
D. Declarative customizations generally require less maintenance.
Ans - A,C
--------------------------------------------------------------------------------
8. What are three considerations when using the Invocatlevethod annotation in Apex
choose 3 answers
A. Only one method using the invocablestethod annotation can be defined per Apex
class
B. A method using the invaablanethod annotation can have multiple input parameters
C. A method using the invocabletthod annotation can be declared as Public or
Global.
D. A method using the sinvecableltethod annotation must define a return value.
E. A method using the invocablevethod annotation must be dedared as static.
Ans - A,C,E
-----------------------------------------------------------------------------------
9. Which code displays the contents of a Visualforce page as a PDF?
A. <apex:page contentType='pdf'>
B. <apex:page contentType='application/pdf'>
C. <apex:page renderAs='application/pdf'>
D. <apex:page renderAs='pdf'>
Ans - D
---------------------------------------------------------------------------------
10. What should a developer use to obtain the Id and Name of all the Leads,
Accounts, and Contacts that have the company name "Universal Containers"?
A. SELECT Lead(id, name), accont(id, name), contact(id,name)FROM Lead, account,
contact where name ='Universal Containers";
B. Find 'Universal Containers' IN NAme Fields RETURNS lead (id,name),account
(id,name),contact(id,name);
C. select Lead.id,Lead.name,Account.id,Account.Name,Contact.Id,Contact.Name, fromt
Lead,Account,Contact where companyName = 'Universal Containers';
D. FIND 'Universal Containers' IN ComapanyName fields RETURNS
lead(id,name),account(id,name),contact(id,name);
Ans - B
-----------------------------------------------------------------------------------
-----------------
11. How many Accounts will be inserted by the following block of code?
for(Integer i=0;i<500;i+++)
{
Account A= new Account(NAme = new Account '+i);
insert a;
}
A. 0
B. 150
C. 500
D. 100
Ans - A
-----------------------------------------------------------------------------------
-----------------
12. A developer created a new trigger that inserts a Task when a new lead is
created. After deploying to production, an outside integration that reads task
records is periodically reporting errors.
Which change should the developer make to ensure the integration is not affected
with minimal impact to business logic
A. Use the Database method with 120 None set to falar.
B Deactivate the trgger before the integration runs.
C. Use try-catch block after the insert statement.
D. Remove the Apex dass from the integration user's profile
Ans - A
-----------------------------------------------------------------------------------
------------------
13. While working in a sandbox, an Apex test fails when run in the Test Framework.
However, running the Apex test logic in the Execute
Anonymous window succeeds with no exceptions or errors.
Why did the method fail in the sandbox test framework but succeed in the Developer
Console
A. The test method relies on existing data in the sandbox
B. The test method does not use syns. Sans to execute as a specific user
C. The test method is calling an uare method.
D. The test method has a syntax error in the code.
Ans- A
-----------------------------------------------------------------------------------
-------------------
14. A developer needs to have records with specific field values in order to test a
new Apex class.
What should the developer do to ensure the data is available to the test?
A. Use Anonymous Apex to create the required data.
B. Use Test.loadData() and reference a JSON file in Documents.
C. Use Test.loadData() and reference a csv file in a static resource,
D. Use SOQL to query the org for the required data.
Ans - C
-----------------------------------------------------------------------------------
----------------
15. Which the statements are true about using the @restSetup annotation in an Apex
test
Choose 2 answers
A. Amethod defined with the testSetup annotation executes once for each test method
in the Test class and counts towards
B. In a test setup method, test data is inserted once and made available for all
test methods in the test class
C. The @test Setup annotation is not supported when the @istest(See Alldata=True)
annotation is used.
D.Records created in the test setup method cannot be updated in individual test
methods
Ans- A,C
-----------------------------------------------------------------------------------
----------------------
18. Which three steps allow a custom Scalable Vector Graphic (SVG) to be included
in a Lightning web component?
Choose 3 answers
D. Use the system.limit class to monitor the current CPU governorat consumption
Ans- A,D
-----------------------------------------------------------------------------------
-------------------
25. What is the value of the trigger old context vanable in a betere Instre
trigger?
A. A list of newly created sobjects without IDs
B. null
C. An empty list of sobjects
D. Undefined
Ans- B
-----------------------------------------------------------------------------------
------
26. A developer must troubleshoot to pinpoint the causes of performance issues when
a custom page loads in their org.
Which tool should the developer use to troubleshoot
A. AppExchange
B. Developer Console
C. Visual Studio Code IDE
D. Setup Menu
Ans- B
-----------------------------------------------------------------------------------
----------
27. Instead of sending emails to support personnel directly from Salesforce from
the finish method of a batch process, Universal Containers wants to
notify an external system in the event that an unhandled exception occurs.
What is the appropriate publish/subscribe logie to meet this requirement?
A. Publish the error event using the eventbus.publish() method and have the
externalsystem subscribe to the event using CometID.
B. Publish the error event using the addError() method and write a trigger to
subscribe to the event and notify the external
C. Since this only involves sending emails, no publishing as necessary. Have the
external system subscribe to the SearchApexError event
D. Publish the error event using the addError() method and have the external system
subsenbe to the scentssing CometID.
Ans - A
-----------------------------------------------------------------------------------
--------------------
28. How should a custom user interface be provided when a user edits an Account in
Lightning Experience?
A. Ovemide the Account's Edit button with a Lightning Action,
B. Override the Account's Edit button with a lightning Flow.
C. Override the Account's Edit button with a Lightning page.
D. Override the Account's Edit button with a lightning component
Ans- D
---------------------------------------------------------------------------------
29. How can a developer check the test coverage of active Process Builders and
Flows before deploying them in a Change Set?
A. Use SOQL and the Tooling API.
B. Use the ApexTestResult class.
C. Use the Code Coverage Setup page.
D. Use the Flow Properties page.
Ans - A
------------------------------------------------------------------------------
33. Which statement generates a list of Leads and Contacts that have a field with
the phrase "ACME?
A. List <sObject>> SearchList = [SELEGT Name, ID FROM Contact, Lead wheer Name Iike
* '%ACME%';
B. List <sobjects> searchList = [Find "%ACME%" In ALL FIELDS RETURNING
contacts ,LEad];
C. Map <sObject> searchList =[Find "%ACME%" IN ALL FIELDS RETURNING contact,LEad];
D. List list<<sobjects>> searchList = [Find "%ACME%" In ALL FIELDS RETURNING
contacts ,LEad];
Ans- D
-----------------------------------------------------------------------------------
-------
36. In the Lightning UI, where should a developer look to find information about a
Paused Flow Interview?
A. In the system debug log by filtering on Paused Flow Interview
B. On the Paused Flow Interviews related list for a given record
C. On the Paused Flow Interviews component on the Home page
D. In the Paused Interviews section of the Apex Flex Queue
Ans- D
-----------------------------------------------------------------------------------
------------
38. Which three code lines are required to create a Lightning component on a
Visualforce page
Choose 3 answers
A. $lightning.createComponent
B. $Lightning.useComponent
C. <apex:includeLightning/>
D. $Lightning.use
E. <apex.slds/>
Ans- A,C,D
-----------------------------------------------------------------------------------
------
39. What are two characteristics related to formulas?
Choose 2 answers
Which consideration should the developer be aware of when deciding between SOQL and
SOSU?
Choose 2 answer
A. SOQL is able to return more fields
B. SOQL is able to return more records
C. SOQL is faster for text searches
D. SOQL is faster for text searches
Ans - B,C
----------------------------------------------------------------------------
59. Universal Containers implemented a private sharing model for the Account
object. A custom Account search tool was developed with Apex to
help sales representatives find accounts that match multiple criteria they specify.
Since its release, users of the tool report they can see Accounts they do not own.
What should the developer use to enforce sharing permissions for the currently
logged-in user while using the custom search tool?
A. Use the UserInfo Apex dass to filter all SOQL queries to returned records owned
by the logged-in user.
B. Use the schema describe calls to determine if the logged-in user has access to
the Account object.
C. Use the with sharing keyword on the class dedaration
D. Use the without sharing keyword on the class declaration
Ans - C
-----------------------------------------------------------------------------------
60. Which two are best practices when it comes to Aura component and application
event handling?
Choose 2 answer
A. Use component events to communicate actions that should be handled at the
application level.
B. Reuse the event logie in a component bundle, by putting the logic in the helper
C. Try to use application events as opposed to component events,
D. Handle low-level events in the event handler and re-fire them as higher-level
events,
Ans - B,D
-----------------------------------------------------------------------------------
--------
61. A developer is asked to create a Visuščorce page that displays some Account
fields as well as fields configured on the page layout for related
How should the dezloper implement this request
A. Use the <apex:relatedList> tag
B. Create a controller extension
C. Add a method to the standard controller
D. Use the <apex:include> tag
Ans - A
-----------------------------------------------------------------------------------
----------
62. Which Salesforce feature allows a developer to see when a user last logged in
to Salesforce it real-time notification is not required?
A. Calendar Events
B. Asynchronous Data Capture Events
C. Event Monitoring Log
D. Developer Log
Ans- C
-----------------------------------------------------------------------------------
--