0% found this document useful (0 votes)
371 views9 pages

PD1 Set2

1. The @TestSetup annotation should be used to insert test data that will be available for every test method in a test class. 2. A Data Export scheduled job should be used to back up all data and attachments in an org once a month. 3. Records created by triggers represent the model part of the MVC framework, and validation rules represent the controller part by enforcing business rules.

Uploaded by

Kashyap Joshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
371 views9 pages

PD1 Set2

1. The @TestSetup annotation should be used to insert test data that will be available for every test method in a test class. 2. A Data Export scheduled job should be used to back up all data and attachments in an org once a month. 3. Records created by triggers represent the model part of the MVC framework, and validation rules represent the controller part by enforcing business rules.

Uploaded by

Kashyap Joshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

1.

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

A. Upload the SVG as a static resource


B. Import the static resource and provide a variable for it in JAvascript
C. Reference the import in the HTML template.
D. Reference the variable in the HTML template,
E. Import the SVG as a content asset file.
Ans- A,B,D
---------------------------------------------------------------------------
19. Which exception type cannot be caught?
A. CalloutException
B. LimitException
C. A Custom Exception
D. NoAccessException
Ans - B
-----------------------------------------------------------------------------
21. Universal Containers uses a simple Order Management app. On the Order Lines,
the order line total is calculated by multiplying the item price with
the quantity ordered. There is a master-detail relationship between the Order and
the Order lines object.
What is the best practice to get the sum of all order line totals on the order
header?
A. Roll-up summary field
B. Dedarative Roll-up Summaries app
C. Apex Trigger
D. Process builder
Ans - A
-----------------------------------------------------------------------------------
--------------
22. A team of developers is working on a source-driven project that allows them to
work independently, with many different org configurations.
Which type of Salesforce orgs should they use for their development?
A. Developer orgs
B. DEveloper sandbox
C. Full copy sandbox
D. Scrach orgs
Ans - D
-----------------------------------------------------------------------------------
-------------------
23. Since Aura application events follow the traditional publish-subscribe model,
which method is used to fire an event?
A. fire()
B. emit()
C. registeEvent()
D. fireEvent()
Ans - A
-----------------------------------------------------------------------------------
-------------------
24. A developer has identified a method in an Apex class that performs resource
intensive actions in memory by tecating over the
SOQL statement on the account. The method also performs a DME statement to save
the changes to the database.
Which two techniques should the developer implement as a best practice to ensure
transaction control and avoid exceeding governor
Choose 2 answers
A. Use the Database.savepoint method to enforce database integrity.
B. Use partial DML Statements to ensure only valid data is committed
C. Use the @Readonly only annotation to bypass the number of rows returned by SOQL.

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

A.Formulas can reference themselves.


B. Formulas can reference values in related objects.
C. Fields that are used in a formula field can be deleted or edited without editing
the formula.
D. Formulas are calculated at runtime and are not stored in the database.
Ans - B,D
---------------------------------------------------------------
40. What is a benefit of developing applications in a multi-tenant environment?
A. Default out-of-the-box configuration
B. Unlimited processing power and memory
C. Enforced best practices for development
D. Access to predefined computing resources
Ans - A
--------------------------------------------------------------------------
41. Which action may cause triggers to fire?
A. Changing a user's default division when the transfer division option is checked
B. Renaming or replacing a picklist entry
C. Updates to Feed Items
D. Cascading delete operations
Ans - C
-----------------------------------------------------------------------------------
--------
42. 2. Which two events need to happen when deploying to a production org?
Choose 2 answers

A. All Apex code must have at least 75% test coverage


B. All Visual Flows must have at least 1% test coverage.
C. All triggers must have some test coverage.
D. All process builder processes must have at least 1% test coverage.
Ans- A,C
-----------------------------------------------------------------------------------
---
43. Which three statements are true regarding custom exceptions in Apex?
Choose 3 answers
A. A custom exception class must extend the system Exception class.
B. A custom exception dass cannot contain member variables or methods.
C. A custom exception class can implement one or many interfaces.
D. A custom exception class name must end with "Exception",
E. A custom exception class can extend other classes besides the exception class.
Ans- A,C,D
----------------------------------------------------------------------------
44. The Job_Application__c custom object has a field that is a master-detail
relationship to the Contact object, where the Contact object is the master.
As part of a feature implementation, a developer needs to retrieve a list
containing all Contact records where the related Account Industry is Technology,
while also retrieving the Contact's job_Application__c records

Based on the object's relationships, what is the most efficient statement te


retrieve the list of Contacts? SELECT A BEST Id FROM Applications
A. [SELECT Id, (Select Id from Job_Application__c) from contact where
Account.Industry ='Technology'];
B. [SELECT Id, (Select Id from Job_Application__c) from contact where
Accounts.Industry ='Technology];
C. [SELECT Id, (Select Id from Job_Application__c) from contact where
Account.Industry ='Technology'];
D. [SELECT Id, (Select Id from Job_Application__c) from contact where
Accounts.Industry ='Technology'];
Ans - A
-----------------------------------------------------------------------------------
---------------------------------------------------------------
45. A developer writes a trigger on the Account object on the before update event
that increments a count field. A worldlowe rule also increments the count
field every time that an Account is created or updated. The field update in the
workflow rule is configured to not re-evaluate workflow rules
an Account is inserted with an initial value of zere, assuming no other automation
logic is implemented
What is the value of the count field on the Account?
A. 1
B. 4
C. 2
D. 3
Ans - C
-----------------------------------------------------------------------------------
------------------------------------------------
46. What is the result of the following code snippet?
publie void dowork (Account acc){
for (Integer i=0;i<=200;i++)
{
insert accc;
}
}
A. O Accounts are inserted.
B. 1 Account is inserted.
C. 200 Accounts are inserted.
D. 201 Accounts are inserted.
Ans - A
-------------------------------------------------------------------
50. Universal Containers (UC) uses a custom object called Vendor, The Vendor custom
object has a master-detail relationship with the standard Account object
Based on some internal discussions, the UC administrator tried to change the
master-detail relationship to a lookup relationship but was not able to do so

Whats a possible reason that this change was not permitted?


A. The Account object is included on a workflow on the Vendor object.
B. The vendor best must use a master-detail field for reporting,
C. The Vendor records tive Sisting values in the Account object.
D. The Recount records contain Vendor roll-up surnmary fields.
Ans- D
-----------------------------------------------------------------------------------
---
53. A developer must write an Apex method that will be called from a Lightning
component. The method may delete an Account stored in the accountRec variable.
Which method should a developer use to ensure only users that should be able to
delete Accounts can successfully perform deletions?
A. Schema.sObject.Account.isDeletable()
B. accountRec.isDeletable()
C. Account.isDeletable()
D. accountRec.sObjectType.isDeletable()
Ans- A
-----------------------------------------------------------------------------------
-------------------------------------
56. A developer has an integer variable called mattempts. The developer needs to
ensure that once maxacampte is initialized, it preserves
its value for the length of the Apex transaction; while being able to share the
variable's state between trigger executions
How should the developer declare maattempt to meet these requirements?

A. Declare maxAttempts as a member vanable on the trigger definition


B. Dedare maxAttempts as a private static vanable on a helper class.
C. Declare maxAttempts as a variable on a helper class.
D. Declare maxAttempts pe as a constant using the static and final keywords
Ans - D
-----------------------------------------------------------------------------------
----------------
58. Universal Containers hires a developer to build a custom search page to help
users find the Accounts they wan on Name Description, and a custom comments field.

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
-----------------------------------------------------------------------------------
--

You might also like