0% found this document useful (0 votes)
256 views

PD1 Original

The document contains questions and answers related to Apex, Visualforce, and Lightning development in Salesforce. Some key points: - Developer and Developer Pro sandboxes have different storage limits. The Data Import Wizard is a client application provided by Salesforce. - A trigger on the Account object would fire twice if a new Account is inserted - once for the insert and once for the update by the workflow rule. - To override the Contact edit button, a developer should use a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. - Workflow rules, roll-up summary fields, and triggers can affect the number of times a trigger fires.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
256 views

PD1 Original

The document contains questions and answers related to Apex, Visualforce, and Lightning development in Salesforce. Some key points: - Developer and Developer Pro sandboxes have different storage limits. The Data Import Wizard is a client application provided by Salesforce. - A trigger on the Account object would fire twice if a new Account is inserted - once for the insert and once for the update by the workflow rule. - To override the Contact edit button, a developer should use a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. - Workflow rules, roll-up summary fields, and triggers can affect the number of times a trigger fires.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

1. When importing and exporting data into salesforce, which 2 statements are true?

Developer and Developer Pro Sandboxes have different storage limits


Data Import Wizard is a client application provided by Salesforce

2. A developer writes a single trigger on the Account object on the after insert and after update
events. A workflow rule modifies a field every time an Account is created or updated. How
many times will the trigger fire if a new Account is inserted, assuming no other automation
logic is implemented on the Account?
2

3. A developer must provide custom user interfaces when users edit a Contact in either
Salesforce Classic or Lightning Experience. What should the developer use to override the
Contact's Edit button and provide this functionality?
A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience

4. Which three operations affect the number of times a trigger can fire?

Lightning Flows, Roll Up Summary Fields, Workflow Rules

5. A developer identifies the following triggers on the Expense object:

deleteExpense,

applyDefaultsToExpense,

validateExpenseUpdate:

The triggers process before delete, before insert, and before update events respectively.

Which two techniques should the developer implement to ensure trigger best practices are
followed?

Choose 2 answers

Unify all three triggers in a single trigger on the Expense object that includes all events.

Create helper classes to execute the appropriate logic when a record is saved.

6. 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?

Schema.sObjectType.Account.isteletable)
7. A workflow updates the value of a custom field for an existing Account. How can a developer
access the updated custom field value from a trigger?

By writing an After Update trigger and accessing the field value from Trigger.Old (before update –
trigger.new)

8. The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists
across different objects. What is an approach a developer can take to streamline maintenance of the
picklists and their values, while also restricting the values to the ones mentioned above?

Create the Picklist on each object and use a Global Picklist Value Set containing the values.

9. An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for
Lightning Web components to use. What is the correct definition of a Lightning Web component
property that uses the getaccounts method?

@wire(getAccounts, (searchTerm: ’$searchTerm’))

accountList;

10. Which code in a Visualforce page and/or controller might present a security vulnerability?

<apex:output Text escape="false" value="(16CurrentPage.parameters.userInput)" />

11. Which two are phases in the Aura application event framework?

Default, Bubble

12. Instead of sending emails to support personnel directly from Salesforce, Universal
Containers wants to notify an external system in the event that an unhandled exception occurs.
What is the appropriate publish/subscribe logic to meet this requirement?

Publish the error event using the Eventbus.publish () method and have the external system subscribe
to the event using CometD.

13. 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?

@TestSetup

14. How should a custom user interface be provided when a user edits an Account in Lightning
Experience?

Override the Account’s Edit button with a Lightning Component


15. A developer receives an error when trying to call a global server-side method using the
@0remoteAction decorator. How can the developer resolve the error?

Add static to the server side method signature

16. Example 2, Example 3

17. What is an example of a polymorphic lookup field in Salesforce?

The WhatId field on the standard Event object

18. What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3
answers

A method using the @InvocableMethod annotation can be declared as Public or Global.

Only one method using the @InvocableMethod annotation can be defined per Apex class.

A method using the @InvocableMethod annotation must be declared as static.

19. Which statement should be used to allow some of the records in a list of records to be inserted if
others fail to be inserted?

Database.insert(records, false)

20. Which process automation should be used to send an outbound message without using an Apex
code?

Workflow Rule

21. When using SalesforceDX, what does a developer need to enable to create and manage
scratch orgs?

Dev Hub

22. What is a fundamental difference between a Master-Detail relationship and a Lookup


relationship?

A Master-Detail relationship detail record inberits the sharing and security of its master record.

23. What will be the output in the debug log in the event of a QueryException during a call to the
aQuery method in
the following example?

class myClass {

class CustomException extends QueryException ()

public static Account aQuery() (

Account theAccount;

try {

system.debug ("Querying Accounts.');

theAccount= [SELECT Id FROM Account WHERE CreatedDate > TODAY];

catch (CustomException ex) {

system.debug Custon Exception.");

catch (QueryException exi){

system.debug('Query Exception.");

finally {

system.debug ("Done.");

return theAccount:

Querying Accounts. Query Exception. Done

24. Given the following Apex statement:

Account myAccount = [SELECT Id, Name FROM Account];

What occurs when more than one Account is returned by the SOQL query?

An unhandled exception is thrown and the code terminates.

25. Which two statements are true about Getter and Setter methods as they relate to Visualforce?

Choose 2 answers
Getter methods can pass a value from a controller to a page.

Setter methods can pass a value from a controller to a page.

26. Which exception type cannot be caught?

LimitException

27. What is the value of the Trigger.old context variable in a Before Insert

trigger? null

28. What does the Lightning Component framework provide to

developers? Prebuilt components that can be reused

29. Universal Containers hires a developer to build a custom search page to help users find the
Accounts they want.

Users will be able to search on Name, Description, and a custom comments field.

Which consideration should the developer be aware of when deciding between SOQL and SOSL?

Choose 2 answers

SOQL is able to return more records.

SOSL is faster for text searches.

30. Which two characteristics are true for Aura component events?

Choose 2 answers

The event propagates to every owner in the containment hierarchy.

If a container component needs to handle a component event add a handlefacets=”capture”


attribute to its handler

31. Universal Containers wants to assess the advantages of declarative development


versus programmatic customization for specific use cases in its Salesforce implementation.

What are two characteristics of declarative development over programmatic customization?

Choose 2 answers

Declarative development can be done using the Setup UI.

Declarative development does not require Apex test classes.


32. What should be used to create scratch orgs?

Salesforce CLI

33. If Apex code executes inside the execute () method of an Apex class when implementing the
Batchable interface,

which two statement are true regarding governor limits?

Choose 2 answers

The Apex governor limits are reset for each iteration of the execute() method.

The Apex governor limits might be higher due to the asynchronous nature of the transaction.

34. Which Salesforce feature allows a developer to see when a user last logged in to Salesforce
if real-time

notification is not required?

Event Monitoring Log

35. Which three statements are accurate about debug logs?

Choose 3 answers

Manage users or view all data permission.

Debug Log levels are cumulative, where FINE log level includes all events logged at the DEBUG,

INFO, WARN, and ERROR levels.

Amount of information logged in the debug log can be controlled by the log levels.

36. A developer created a Visualforce page and custom controller to display the account type field
as shown below.

Custom controller code:

public with sharing class customCtrir{

private Account theAccount:

public String actType:

public customCerit (){

the Account (SELECT Id, Type FROM Account


WHERE Id:ApexPages.currentPage().getParameters().get("id")]=

actType theAccount.Type:

Visualforce page snippet:

The Acceant Type is (tactType)

The value of the account type field is not being displayed correctly on the page. Assuming the
custom controller is

properly referenced on the Visualforce page, what should the developer do to correct the
problem?

Add a getter method for the actType attribute.

37. A Lightning component has a wired property, searchResults, that stores a list of Opportunities.

Which definition of the Apex method, to which the searchResults property is wired, should be
used?

@Aura Enabled (cacheable=true)

public static List<Opportunity> search (String term) {/implementation /}

38. Which two statements accurately represent the MVC framework implementation in
Salesforce?

Choose 2 answers

Validation rules enforce business rules and represent the Controller (C) part of the MVC
framework

Records deleted or updated by triggers represent the Model (M) part of the MVC framework.

39. A developer needs to confirm that a Contact trigger works correctly without changing the
organization's data.

What should the developer do to test the Contact frigger?

Use the Test menu on the Developer Console to run all test classes for the Contact trigger.
40. A developer needs to implement the functionality for a service agent to gather multiple pieces
of information from

a customer in order to send a replacement credit card.

Which automation tool meets these requirements?

Flow Builder

41. How can a developer check the test coverage of active process builder and flow before deploying
them in a change set?

Tooling API
42. A developer must create a ShippingCalculator class that cannot be instantiated and must include
a working default implementation of a calculate method, that sub-classes can override.
What is the correct implementation of the ShippingCalculator class?

public abstract class shippingcalculator {

public virtual void calculate () / *implementation"/

43. A developer must create an Apex class, ContactController, that a Lightning component can use to
search for
Contact records. Users of the Lightning component should only be able to search for Contact records
to which
they have access.
Which two will restrict the records correctly?

public inherited sharing class ContactController


public with sharing class ContactController

44. What are three characteristics of change set deployments?

Choose 3 answers

Change set can be used in one-way, single transaction.


Change set requires a deployment connection.
Change sets can be used in related organizations.

45. Which statement generates a list of Leads and Contacts that have a field with the
phrase 'ACME'?

List<List <sObject>> searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead);

46. A developer wrote Apex code that calls out to an external system.

How should a developer write the test to provide test coverage?


Write a class that implements the HTTPCalloutMock interface.

47. A developer creates a new Apex trigger with a helper class, and writes a test class that only
exercises 95% coverage of the new Apex helper class.

Change Set deployment to production fails with the test coverage warning:
"Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required."
What should the developer do to successfully deploy the new Apex trigger and helper class?

Create a test class and methods to cover the Apex trigger

48. A custom picklist field, Food Preferenceille, exists on a custom object. The pickdist contains
the following
options: "Vegan', 'Kosher, 'No Preference', The developer must ensure a value is populated every
time a record is
created or updated.
What is the most efficient way to ensure a value is selected every time a record is saved?

Mark the field as Required on the field definition.

49. A developer has the following requirements:


Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not in stock.

Which relationship implementation supports these requirements?

Line Item has a Master-Detail field to Order and the Master can be re-parented.
Order has a Master-Detail field to Line Item and there can be many Line Items per Order.

50. Since Aura application events follow the traditional publish-subscribe model, which method is
used to fire an event?

Fire()

51. Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One
of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and
its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the
consumer of the namespace. application when developing customizations outside the ISV's package
Which approach should a developer take to ensure calculateBodyFat () is accessible outside the
package
namespace?

Declare the class and method using the global access modifier.
52. A Primary Id_c custom field exists on the Candidate_c custom object. The field is used to
store each candidate's id number and is marked as Unique in the schema definition.
As part of a data enrichment process, Universal Containers has a CSV file that contains updated data
for all candidates in the system. The file contains each Candidate's primary id as a data point.
Universal Containers wants to upload this information into Salesforce, while ensuring all data rows
are correctly mapped to a candidate in the system.
Which technique should the developer implement to streamline the data upload?

Update the primaryid c field definition to mark it as an External Id

53. What are two characteristics related to formulas?

Choose 2 answers

Formulas are calculated at runtime and are not stored in the database.
Formulas can reference values in related objects.

54. What is the result of the following code snippet?


public void dowork(Account acct) {

for (Integer i - 0; 1 <. 200; 1+><


insert acct;

0 Accounts are inserted

55. A recursive transaction is initiated by a DML statement creating records for these two objects:
. Accounts
Contacts

The Account trigger hits a stack depth of 16.

Which statement is true regarding the outcome of the transaction?

The transaction succeeds and all the changes are committed to the database.

56. Which two types of process automation can be used to calculate the shipping cost for an Order
when placed and apply percentage of the shipping cost to some of the related Order Products?

Flow builder
Process builder

57. developer wants to mark each Account in a ListAccounts as either Active or Inactive based on
the LastModifiedDate field value being more than 90 days.

A for loop, with an if/else statement inside

58. Which aspect of apex programming limited due to multitenancy?

The number of records returned from database queries


59. what are the two ways that a controller and extension can be specified for a custom object
named Notice on a visual force pages ?

apex:page controller-"Account extensions-"myControllerExtension"


apex:page standardController="Account extensions-"myControllerExtension"

60. Universal Containers recently transitioned from Classic Lightning Experience. One of its business
processes
requires certain values from the Opportunity object to be sent via an HTTP REST callout to its
external order management system based on a user-initiated action on the Opportunity detail page.
Example values are as follows:
Name . Amount
• Account Which two methods should the developer implement to fulfill the business requirement?

Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action
toexpose the component on the Opportunity detail page

Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick actionto
expose the component on the Opportunity detail page

61. With annotation exposes an apex class as a restful web service?

@RestResource

62. 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 specity.
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?

Use the with sharing keyword on the class declaration

63. Which three code lines are required to create a Lightning component on a Visualforce page?

<apex:includeLightning/>
$Lightning.use (Missed)
$Lightning.createComponent

64. A team of many developers work in their own individual orgs that have the same configuration
as the production org.

Developer Sandbox

65. What are three capabilities of the citng requires tag when loading JavaScript resources in Aura
components?
One-time loading for duplicate scripts
Specifying loading order
Loading scripts in parallel.

1. Universal Containers wants Opportunities to no longer be editable when reaching the


Closed/Won stage. How should a developer accomplish this?

Use a validation rule.

2. Which Salesforce org has a complete duplicate copy of the production org including data and
configuration?

Full Sandbox

3. The following Apex method is part of the Contact Service dass that is called from a trigger:

public static void setBusinessUnitToEMEA (Contact thisContact) { thisContact. Business


Unit_c='EMEA': update thisContact:

How should the developer modify the code to ensure best practices are met?

public static void setBusiness UnitToEMEA (List<Contact> contacts) {

for Contact thisContact: contacts){

thisContact. Business Unit C = "EMEA':

update contacts;

4. A developer has the following requirements:

. Calculate the total amount on an Order.

• Calculate the line amount for each Line Item based on quantity selected and price.

. Move Line Items to a different Order if a Line Item is not in stock.

Which relationship implementation supports these requirements?

Line Item has a Master-Detail field to Order and the Master can be re-parented.

5. A developer is implementing an Apex class for a financial system. Within the dass, the variables
'creditAmount and 'debitAmount should not be able to change once a value is assigned.

In which two ways can the developer declare the variables to ensure their value can only be assigned
one time?

Choose 2 answers

A. Use the final keyword and assign its value when declaring the variable.
B. Use the final keyword and assign its value in the class constructor.

6. Which action may cause triggers to fire?

Updates to feed items

7. Universal Containers wants a list button to display a Visualforce page that allows users to edit
multiple records.

Which Visualforce feature supports this requirement?

recordSetVar page attribute

8. A developer wants to invoke an outbound message when a record meets a specific criteria.

Which three features satisfy this use case?

Choose 3 answers

B. Process Builder can be used to check the record criteria and then call Apex code.

C. Workflows can be used to check the record criteria and send an outbound message.

E. Approval Process has the capability to check the record criteria and send an outbound message
without Apex code.

9. A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter.

How should the developer prevent a cross site scripting vulnerability?

ApexPages.currentPage().getParameters ().get("url_param') .escapeHtml4 ()

10. In the following example, which sharing context will myMethod execute when it is invoked?

public Class myClass ( public void myMethod() { / implementation */ }

Sharing rules will be inherited from the calling context.

11. A developer needs to have records with specific field values in order to test a new Apex dass.

What should the developer do to ensure the data is available to the test?

Use Test. IoadData() and reference a static resource.

12. Instead of sending emails to support personnel directly from Salesforce, Universal Containers
wants to notify an external system in the event that an unhandled exception occurs.

What is the appropriate publish/subscribe logic to meet this requirement?

Publish the error event using the Eventbus.publish() method and have the external system subscribe
to the event using CometD.

13. Which exception type cannot be caught?

LimitException

14. 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 to retrieve the list of
contacts?

[SELECT id, (SELECT Id FROM Job_Applications r FROM Contact WHERE Account. Industry -
Technology' ];

15. Given the following Anonymous Block:

List<Case> casesToUpdate = new List<Case>(); for (Case thisCase: [SELECT id, Status FROM Case
LIMIT 50000]){

thisCase.Status 'Working': casesToUpdate.add(thisCase);

Try{

Database.update (casesToUpdate, false);

}catch(Exception e){

System.debug (e.getMessage());

What should a developer consider for an environment that has over 10.000 Case records?

The transaction will fail due to exceeding the governor limit.

16. 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?

Scratch orgs

17. Which statement describes the execution order when triggers are associated to the same object
and event?

Triggers are executed in the order they are created.

18. A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine
a discount level for a Contact, based on a number of factors.

What is the correct definition of the Apex method?

@InvocableMethod

global static List<List<Recommendation>> getLevel (List<ContactWrapper> input) {


/*implementation*/ }

19. A developer wants to import 500 Opportunity records into a sandbox.

Why should the developer choose to use Data Loader instead of Data Import Wizard?

Data Import Wizard does not support Opportunities.


20. Which two are best practices when it comes to Aura component and application event handling?

Choose 2 answers

Handle low-level events in the event handler and re-fire them as higher-level events.

Reuse the event logic in a component bundle, by putting the logic in the helper.

21. A custom picklist field, Food Preference_, exists on a custom object. The pickdist contains the
following options: "Vegan, Kosher', 'No Preference. The developer must ensure a value is populated
every time a record in created or updated.

Mark the field as Required on the field definition.

22. What are three benefits of using declarative customizations over code?
Choose 3 answers

Declarative customizations do not require user testing


Declarative customizations automatically update with each Salesforce release.
Declarative customizations generally require less maintenance.

23. What are two ways a developer can get the status of an enqueued job for a dass that
implements the queuestl interface?
Choose 2 answers

Query the AsyncApexJob object


View the Apex Jobs Page

24. What is the result of the following code?


Account a new Account();
Database.inserti(a, false);

The record will not be created and no error will be reported.

25. How many Accounts will be inserted by the following block of


code? for(Integer 1 = 0; i < 500; 14+11 Account
Account & new Account (Name-'New +i)

26. Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightning
web component?

Import the static resource and provide a variable for it in JavaScript.


Upload the SVG as a static resource.
Reference the import in the HTML template.

27. An Opportunity needs to have an amount rolled up from a custom object that is not in a
Master/Detail relationship. How can this be achieved?
Write a trigger on the child object and use an aggregate function to sum the amount for all related
child objects under the Opportunity.

28. When a user edits the Postal Code on an Account, a custom Account text field named timezone
must be updated based on the values in a PostalCodeToTimezone e custom object.

Build a Flow with Flow Builder.

29. A developer created these three Rollup Summary fields in the custom object., Project :

Total Timesheets_c

Total Approved Timesheets_ Total Rejected Timesheet_c

The developer is asked to create a new field that shows the ratio between rejected and approved
timesheets for a given project.

What are two benefits of choosing a formula field instead of an Apex trigger to fulfill the Choose 2
answers

A test class that validates the formula field is needed for deployment.

A formula field will calculate the value retroactively for existing records.

30. An org has an existing Flow that creates an Opportunity with an Update Records element. A
developer must update the Flow to also create a Contact and store the created Contact's ID on the
Opportunity.Which update should the developer make in the Flow?

Add a new Create Records element.

31. Universal Containers (UC) wants to lower its shipping cost while making the shipping process
more efficient. Distribution Officer advises UC to implement global addresses to allow multiple
Accounts to share a default pickup address. The developer is tasked to create the supporting object
and relationship for this business requirement and uses the Setup Menu to create a custom object
called "Global Address".The Which field should the developer add to create the most efficient
model that supports the business need?

Add a Lookup field on the Account object to the Global Address object.

32. What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts
that have company name "Universal Containers"?

FIND 'Universal Containers IN Name Fields RETURNING lead(id, name), accountiid, name), contact(id,
name)
33. Flow Builder uses an Apex Action to provide additional information about multiple Contacts,
stored in a custom class, Contact Info. Which is the correct definition of the Apex method that gets
the additional information?

@Invocableltethod (label='Additional Info's


public static List<contactinfo> getinfo(list<id> contactids)
{implementation /}

34. How does the Lightning Component framework help developers implement solutions faster?

By providing device-awareness for mobile and desktops

35. developer has to identify a method in an Apex class that performs resource intensive actions in
memory iterating over the result set of a SOQL statement on the account. The method also performs
a DHL statement to save the changes to the database.by Which two techniques should the
developer implement as a best practice to ensure transaction control and avoid exceeding governor
limits?

Use the System.Limit class to monitor the current CPU governor limit consumption.
Use the Database.Savepoint method to enforce database integrity.

36. A developer considers


Boolean 18OR
integer x:
String the string 'Hello':
if (180k-false as theString 'Hello'){
3 eleif (LOK true as theftring 'Hella) (
x = 2:
else if (18OR - null as theftring 'Hella) (
i else (

the following snippet of code:


Based on this code, what is the value of x?

37. Which action causes a before trigger to fire by default for Accounts?

Importing data using the Data Loader and the Bulk API

38. Which three statements are true regarding custom exceptions in Apex?
Choose 3 answers
A custom exception class can implement one or many interfaces.
A custom exception class name must end with "Exception
A custom exception class must extend the system Exception class.

39. developer created a new trigger that inserts 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?

Use the Database method with allOrnone set to False.

40. Which two characteristics are true for Aura component events?
Choose 2 answers

The event propagates to every owner in the containment hierarchy.

If a container component needs to handle a component event add a handlefacets=”capture”


attribute to its handler

41. Which two operations can be performed using a formula field?

Choose 2 answers

Displaying an Image based on the Opportunity Amount

Calculating a score on a Lead based on the information from another field

42. A developer must implement a CheckPayment Processor dass that provides check
processing payment capabilities that adhere to what is defined for payments in the Payment
Processor interface.

public interface Payment Processor ( void pay (Decimal amount);

Which is the correct implementation to use the Payment Processor interface class?

public class CheckPayment Processor implements Payment Processor (

public void pay (Decimal amount) ()

43. A developer has an integer variable called maxAttempts. The developer needs to ensure that
once maxAttempts 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 maxAttempts to meet these requirements?

Declare maxAttempts as a constant using the static and final keywords.

44. Which process automation should be used to send an outbound message without using Apex
code?

Workflow Rule

45. Which Apex class contains methods to return the amount of resources that have been used for a
particular governor, such as the number of DML statements?

Limits
46. While working in a sandbox, an Apex test fails when run in the Test Framework. However,
running the Apex tant 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?

The test method relies on existing data in the sandbox.

47. Which scenario is valid for execution by unit tests?

Set the created date of a record using a system

method.

48. A developer wants to get access to the standard price book in the org while writing a test dass
that covers an OpportunityLineItem trigger.

Which method allows access to the price book?

Use Test.getStandard PricebookId() to get the standard price book ID.

49. Which three data types can a SOQL query return?

Integer

sObject

List

50. A developer has two custom controller extensions where each has a save() method.

Which save() method will be called for the following Visualforce page?

<apex:page standardController="Account", extensions="ExtensionA, Extension">


<apex:commandButton action="save)" value-"Save"/>

</apex:page>

standard controller save()

51. Universal Containers wants to notify an external system, in the event that an unhandled
exception occurs, by publishing a custom event using Apex. What is the appropriate
publish/subscribe logic to meet this requirement?

Publish the error event using the Eventbus.publish () method and have the external system subscribe
to the event using CometD.

52. A developer is tasked to perform a security review of the Contact Search Apex class that exists in
the system. Within the class, the developer identifies the following method as a security threat:

List Contact performsearch(String lastName){

return Database.query('SELECT id, FirstName, LastName FROM Contact WHERE LastName Like
%+lastName+"");

What are two ways the developer can update the method to prevent a SOQL injection attack?

Choose 2 answers
Use variable binding and replace the dynamic query with a static SOQL.

Use the escapeSingleQuotes method to sanitize the parameter before its use.

53. A developer must create a Lightning component that allows users to input Contact record
Information to create a Contact record, including a Salary_c custom field. What should the developer
use, along with a lightning-record-edit-form, so that Salary_c field functions as a currency input and
is only viewable and editable by users that have the correct field level permissions on Salary_c?

<lightning-input-field field-name="Salary_c"> </lightning-input-field>

54. Universal Containers stores Orders and Line Items in Salesforce. For security reasons, financial
representatives are allowed to see information on the Order such as order amount, but they should
not be allowed to see the Line Items on the Order. Which type of relationship should be used
between Orders and Line Items?

Lookup

55. Universal Containers has an order system that uses an Order Number to identify an order for
customers and service agents. Order records will be imported into Salesforce. How should the Order
Number field be defined in Salesforce?

Number with External ID

56. Which Lightning code segment should be written to declare dependencies on a Lightning
component, c:accountList, that is used in a Visualforce page?

<aura:application access="GLOBAL" extends="ltng: outApp"> <aura:dependency


resource="c:accountList"/>

</aura:application>

57. Universal Containers decides to use exclusively declarative development to build out a new
Salesforce application. Which three options should be used to build out the database layer for the
application? Choose 3 answers

Custom objects and fields

Roll-up summaries

Relationships

58. 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?

Developer Console

59. Which aspect of Apex programming is limited due to multitenancy?

The number of records returned from database queries

60. Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if
real-time notification is not required?

Event Monitoring Log


61. A developer must create a Credit Card Payment class that provides an implementation of an
existing Payment class.

public virtual class Payment (

public virtual void makePayment (Decimal amount) { /*implementation*/ 1

Which is the correct implementation?

public class CreditCardPayment extends Payment{

public override void makePayment (Decimal amount){/*implementation*/}

62. 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?

Set the attribute enableLightning to true in the definition.

63. A development team wants to use a deployment script to automatically deploy to a


sandbox during their development cycles. Which two tools can they use to run a script that
deploys to a sandbox?

Choose 2 answers

VSCode

SFDX CLI

64. What are three ways for a developer to execute tests in an org? Choose 3 answers

Metadata API

Setup Menu

Tooling API

65. An Approval Process is defined in the Expense_Item_c object. A business rule dictates that
whenever a user changes the Status to 'Submitted' on an Expense Report e record, all the Expense
Iten_c records related to the expense report must enter the approval process individually. Which
approach should be used to ensure the business requirement is met?

Create a Process Builder on Expense Report_c with a 'Submit for Approval action type to submit all
related Expense Item_records when the criteria is met.
SET 3 --------------------------------------------------------------

1. What is an example of a polymorphic lookup field in Salesforce?

Answer : D. The Whatld field on the standard Event object

2 of 65. The values 'High', 'Medium', and 'Low' are identified as common values for multiple
picklists across different objects.

What is an approach a developer can take to streamline maintenance of the picklists and their
values, while also restricting the values to the ones mentioned above?

Answer : C. Create the Picklist on each object and use a Global Picklist Value Set containing the
values.

3 of 65. What should be used to create scratch orgs?

Answer : C. Salesforce CLI

4 of 65. Cloud Kicks Fitness, an 1SV Salesforce partner, is developing a managed package
application. One of the application modules allows the user to calculate body fat using the Apex
class, Bodyfac, and its method, calculatebodyfat). The product owner wants to ensure this method
is accessible by the consumer of the application when developing customizations outside the 1SV's
package namespace.

Which approach should a developer take to ensure calculateBodyTat() is accessible outside the
package namespace?

Answer : C. Declare the class and method using the global access modifier

[11:22 am, 11/10/2021] Raja❤: 5 of 65. when using SalesforceDX, what does a developer heed to
enable to create and manage scratch orgs?

Answer : B. Dev Hub

[11:24 am, 11/10/2021] Raja❤: 6 of 65.

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

Answer : B .Use the with sharing keyword on the class declaration

[11:25 am, 11/10/2021] Raja❤: 7 of 63. Which statement should be used to allow some of the
records in a list of records to be inserted if others fall to be

inserted?

Answer. B. Database.Insert(records, false)

[11:27 am, 11/10/2021] Raja❤: 8 of 65. Which two are phases in the Aura application event
propagation framework?

Choose 2 answers

Answer :

B. Default

C. Bubble

[11:29 am, 11/10/2021] Raja❤: 9 of 65. A Primary24e custom field exists on the Candidate e
custom object. The field is used to store each candidate's id number and is marked as Unique in
the schema definition.

As part of a data enrichment process, Universal Containers has a CSV file that contains updated
data for at candidates in the system. The file contains each Candidate's primary id as a data point
Universal Containers wants to upload this information into Salesforce, while ensuring all data rows
are correctly mapped to a candidate in the system.

Which technique should the developer implement to streamine the data upload?

Answer : C. Update the PrimaryId_c field definition to mark it as an External ld.

[11:32 am, 11/10/2021] Raja❤: 10 of 65. Instead of sending emails to support personnel directly
from Salesforce. Universal Containers wants external system in the event that an unhanded
exception occurs.

to notify an
What is the appropriate publish/subscribe logic to meet this requirement?

Answer : C. Publish the error event using the Event. Publish() method and have the external
system subscribe to the event using cometD

subscribe to the event using Com

[11:34 am, 11/10/2021] Raja❤: 11 of 65. Which three statements are accurate about debug logs?

Choose 3 answers

Answers :

B. Debug Log levels are cumulative, where FINE log level Includes all events logged at the DEBUG.

INFO, WARN, and ERROR levels.

D. Amount of information logged in the debug log can be controlled programatically.

E. Amount of information logged in the debug log can be controlled by the log levels.

[11:36 am, 11/10/2021] Raja❤: 12 of 65. Which three code lines are required to create lightning
component on a visual force page

Choose 3 answers

B. $Lightning.createComponent

D. <apex:includeLightning/>

E.$Lightning.use

[11:38 am, 11/10/2021] Raja❤: 13 of 65.

Given the following Apex statement:


Account myAccount = (SELECT id, name FROM Account);

What occurs when more than one Account is returned by the SOQL query?

Answer :

C. An Unhandled exception is thrown and the code terminates

[11:40 am, 11/10/2021] Raja❤: 14 of 65.

How can a developer check the test coverage of active Process Builders and Flows before
deploying them Change Set?

Answer :

B. Use the code coverage setup page

[11:41 am, 11/10/2021] Raja❤: 15 of 65. What are three characteristics of change set
deployments?

Choose 3 answers

A. Change sets can be used to transfer records.

B. Sending a change set between two orgs requires a deployment connection.

C . Change sets can only be used between related organizations.

[11:42 am, 11/10/2021] Raja❤: 16 of 65. What does the Lightning Component framework provide
to developers

C. Prebuilt components that can be reused

[11:43 am, 11/10/2021] Raja❤: 17 of 65, When Importing and exporting data into Salesforce,
which two statements are true?

Choose 2 answers

B.Bulk API can be used to bypass the storage limits when importing large data volumes in
development environments.
C. Developer and Developer Pro sandboxes have different storage limits.

[11:44 am, 11/10/2021] Raja❤: 18 of 65. A developer creates a new Apex trigger with a helper
dass, and writes a test dass that only exercises coverage of the new Apex helper class.

Change Set deployment to production fails with the test coverage warning: Test coverage of
selected Apex Trigger is 0%, test coverage is required.

What should the developer do to successfully deploy the new Apex trigger and helper class?

Answer :

B. Create a test class and methods to cover the Apex trigger

[11:44 am, 11/10/2021] Raja❤: 19 of 65. A developer writes a single trigger on the Account object
on the after insert and after update events. A rule modifies a field every time an Account is
created or updated.

How many times will the trigger fire if a new Account is inserted, assuming no other automation
logic is implemented on the Account?

Answer: 2

[11:45 am, 11/10/2021] Raja❤: 20 of 65. Which aspect of Apex programming is limited due to
multitenancy

Answer

B. The number of records returned from database queries

21 of 65. Which two characteristics are true for Aura component events?

Choose 2 answers

B. The event propagates to every owner in the containment hierarchy.

D.Depending on the current propagation phase, calling event atopPropagation () may not stop the
event propagation.

22 of 65. Which process automation should be used to send an outbound message without using
Apex code?

Answer:

A Workflow Rule

23 of 65. Universal Containers wants to assess the advantages of declarative development versus
programmatic customization for specific use cases in its Salesforce implementation.

What are two characteristics of declarative development over programmatic customization?

Choose 2 answers

Answers:

C. Declarative development does not require Apex test classes.

D. Declarative development can be done using the Setup Ut

24 of 65. A developer created a Visualforce page and custom controller to display the account type
field as shown below.

Custom controller code:

public with sharing class customCtrir{

private Account theAccount;

public String actType:

public customCtrir() {

theAccount (SELECT id, Type FROM Account


WHERE Id:ApexPages.currentPage ().getParameters ().get (hid'))

actType theAccount Type:

Answer :

B. Add a getter method for the actType attribute.

[11:51 am, 11/10/2021] Raja❤: 25 of 65. Universal Containers hires a developer to build a custom
search page to help users find the Accounts they want. Users will be able to search on Name,
Description, and a custom comments field.

which consideration should the developer be aware of when deciding between SOQL and SOSL?

Choose 2 answers

B. SOQL is able to return more records

C. SOSL is faster for text searches.

[11:52 am, 11/10/2021] Raja❤: 26 of 65. What is a fundamental difference between a Master-
Detail relationship and a Lookup relationship?

Answer :

D. A Master-Detail relationship detail record inherits the sharing and security of its master record.

[11:52 am, 11/10/2021] Raja❤: 27 of 65. Which annotation exposes an Apex class as a RESTful
web service?

Answer

B. RestResource

[11:53 am, 11/10/2021] Raja❤: 28 of 65. What is the result of the following code snippet?

public void dowork (Account acct){ for (Integer 1 = 0; 1 - 2007 1


insert acct;

Answer

D.0 Accounts are inserted.

[11:54 am, 11/10/2021] Raja❤: 29 of 65. 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

D. Validation rules enforce business rules and represent the Controller (C) part of the MVC
framework.

[11:55 am, 11/10/2021] Raja❤: 30 of 65. Which three operations affect the number of times a
trigger can fire?

Choose 3 answers

B. Lightning Flows

C. Roll-Up Summary fields

D. Workflow Rules

[11:56 am, 11/10/2021] Raja❤: 31 of 65. What will be the output in the debug log in the event of
a QueryException during a call to the aQuery method in the following example?

class syClass {

class CustomException extends QueryException ()

public static Account aQuery() {


Account theAccount;

system.debug ('Querying Accounts.'); theAccount [SELECT Id FROM Account WHERE CreatedDate


> TODAY];

catch (CustomException eX) (

system.debug('Custom Exception.');

catch (QueryException eX) {

systen.debug('Query Exception.');

finally (

systen.debug("Done.");

Answer :

B. Querying Accounts. Query Exception. Done.

[11:57 am, 11/10/2021] Raja❤: Time Remaining : 01:28:57

A workflow updates the value of a custom field for an exdsting Account.

32 of 65. A workflow updates the value of a custom field for an existing account.

How can a developer access the updated custom field value from a trigger?

Answer

A. By writing an After Update trigger and accessing the field value from Trigger. Old

[11:58 am, 11/10/2021] Raja❤: 33 of 65. Which Salesforce feature allows a developer to see when
notification is not required? user last logged in to Salesforce if real-time

Answer

D. Event Monitoring Log

[11:59 am, 11/10/2021] Raja❤: 34 of 65. Since Aura application events follow the traditional
publish-subscribe model, which method is used to

A. fire())

[0:00 pm, 11/10/2021] Raja❤: 35 of 65.

A developer receives an error when trying to call a global server-side method using the
remotection decoratur.

How can the developer resolve the error?

Answer :

A. Add static to the server-side method signature.

[0:00 pm, 11/10/2021] Raja❤: 36 of 65.

A developer needs to implement the functionality for a service agent to gather multiple pieces of
information a customer in order to send a replacement credit card.

Which automation tool meets these requirements?

A. Flow Bullder

[0:01 pm, 11/10/2021] Raja❤: 37 of 65. A developer wants to mark each Account in a list count as
either Active or Inactive based on the LastModifiedDate field value being more than 90 days.

Which Apex technique should the developer use?

Answer

A. A for loop, with an i/else statement inside


[0:02 pm, 11/10/2021] Raja❤: 38of 65.

What are two characteristics relatee to formulas

Choose 2

C . Formulas can reference values in related objects.

D. Formulas are calculated at runtime and are not stored in the database.

[0:03 pm, 11/10/2021] Raja❤: 39 of 65. Which exception type cannot be caught?

Answer:

B. LimitException

[0:03 pm, 11/10/2021] Raja❤: 40 of 65. A developer must provide custom user interfaces when
users edit a Contact in either Salesforce Classic or Lightning Experience.

What should the developer use to override the Contact's Edit button and provide this
functionality?

Answer:

A. A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience

[0:04 pm, 11/10/2021] Raja❤: 41 of 65. A recursive transaction is initiated by a DML statement
creating records for these two objects:

• Accounts Contacts

The Account trigger hits a stack depth of 16.

Which statement is true regarding the outcome of the transaction?

Answer:

A. The transaction succeeds and all changes are committed to the database.

[0:06 pm, 11/10/2021] Raja❤: 2 of 65. A developer must create a ShippingCalculator dass that
cannot be instantiated and must include a

working default implementation of a calculate method, that sub-classes can override

What is the correct implementation of the ShippingCalculator class?

Answer:

C.

public abstract class shippingCalculator (

public virtual void calculate()(/implementation/ )

[0:08 pm, 11/10/2021] Raja❤: 43 of 65. A Lightning component has a wired property,
searchResults, that stores a list of Opportunities.

Which definition of the Apex method, to which the searchResults property is wired, should be
used?

Answer

C. @Aura Enabled (cacheable=true)

public static List<Opportunity> search (String term) {/implementation*/)

[0:09 pm, 11/10/2021] Raja❤: 44 of 63. Which two types of process automation can be used to
calculate the shipping cost for an Order on the Order is placed and apply a percentage of the
shipping cost to some of the related Order Products

Choose 2 answers

A. Process Builder

D. Flow Builder

[0:10 pm, 11/10/2021] Raja❤: 45 of 65. A developer needs to confirm that a Contact trigger works
correctly without changing the organization's data.
What should the developer do to test the Contact trigger?

Answer

B. Use the Test menu on the Developer Console to run all test classes for the Contact trigger,

[0:10 pm, 11/10/2021] Raja❤: 46 of 65. Which two statements are true about Getter and Setter
methods as they relate to Visualforca?

Choose 2 answers

Answers:

B. Setter methods can pass a value from a controller to a page.

C. Getter methods can pass a value from a controller to a page.

[0:11 pm, 11/10/2021] Raja❤: 47 of 65. A custom picklist field, Food Preference__c, exists on a
custom object. The picklist contains the following options: "Vegan', "Kosher', 'No Preference'. The
developer must ensure a value is populated every time a record is created or updated.

What is the most efficient way to ensure a value is selected every time a record is saved?

Answer:

B. Mark the field as Required on the field definition.

[0:12 pm, 11/10/2021] Raja❤: 48 of 65. What are two ways that a controller and extension can be
specified for a custom object named Notice on a Visualforce page?

Choose 2 answers

A. apex:page controller="Notice__c" extensions="myControllerExtension"

D. apex:page standard Controller="Notice_c" extensions="myControllerExtension"

[0:14 pm, 11/10/2021] Raja❤: 49 of 65. Which statement generates a list of Leads and Contacts
that have a field with the phrase "ACME?
C.List <sObject> searchList = [FIND "ACME*" IN ALL FIELDS RETURNING Contact, Lead);

[0:14 pm, 11/10/2021] Raja❤: 50 of 65. An Apex method, getAccounts, that returns a List of
Accounts given a searchTerm, is available for Lightning Web components to use.

What is the correct definition of a Lightning Web component property that uses the getAccounts
method?

Answer

C . @wire (getAccounts, searchTerm: 'ssearchTerm' }) accountList;

[0:15 pm, 11/10/2021] Raja❤: Salesforce Certified Platform Developer I (SU21)

Time Remaining: 01:26:34

51 of 65. Which code in a Visualforce page and/or controller might present a security
vulnerability?

Answer

B.

<apex:outputText escape="false" value="($CurrentPage.parameters.userInput)" />

[0:16 pm, 11/10/2021] Raja❤: 52 of 65. A developer wrote Apex code that calls out to an external
system.

How should a developer write the test to provide test coverage?

Answer

C. Write a class that implements the HTTPCalloutMock interface.

[0:17 pm, 11/10/2021] Raja❤: 53 of 65. What are three capabilities of the <1tng:require> tag
when loading JavaScript resources in Aura components?

Choose 3 answers
C. Specifying loading order

D. Loading scripts in parallel

E. One-time loading for duplicate scripts

[0:18 pm, 11/10/2021] Raja❤: 54 of 65.

A developer has the following requirements: . Calculate the total amount on an Order.

. Calculate the line amount for each Line Item based on quantity selected and price. . Move Line
Items to a different Order if a Line Item is not in stock.

Which relationship implementation supports these requirements

Answer.

C. Line Item has a Master-Detail field to Order and the Master can be re-parented.

[0:19 pm, 11/10/2021] Raja❤: 55 of 65. What is the value of the Trigger.old context variable in a
Before Insert trigger?

Answer

B.null

[0:19 pm, 11/10/2021] Raja❤: 56 of 65. If Apex code executes inside the execute () method of an
Apex class when implementing the Bacchable interface, which two statement are true regarding
governor limits?

Choose 2 answers

A. The Apex governor limits might be higher due to the asynchronous nature of the transaction.

B. The Apex governor limits are reset for each iteration of the execute() method.

[0:20 pm, 11/10/2021] Raja❤: 57 of 65. How should a custom user interface be provided when a
user edits an Account in Lightning Experience
Answer:

C. Override the Account's Edit button with a Lightning component.

[0:21 pm, 11/10/2021] Raja❤: 58 of 65. What are three considerations when using the
@InvocableMethod annotation in Apex?

Choose 3 answers

A. A method using the @InvocableMethod annotation can be declared as Public or Global

D. Only one method using the @InvocableMethod annotation can be defined per Apex class.

E. A method using the InvocableMethod annotation must be declared as static.

[0:22 pm, 11/10/2021] Raja❤: 59 of 65, Universal Containers recently transitioned from Classic to
Lightning Experience. One of its business processes requires certain values from the Opportunity
object to be sent via an HTTP REST callout to its external order management system based on a
user-Initiated action on the Opportunity detall page. Example values are as follows:

• Name

. Amount

• Account

Which two methods should the developer implement to fulfill the business requirement?

Choose 2 answers

Answer :

B. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action
to

expose the component on the Opportunity detail page.


D. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick
action to expose the component on the Opportunity detail

[0:22 pm, 11/10/2021] Raja❤: 60 of 65. A developer must create an Apex class, ContactController,
that a Lightning component can use to search for Contact records. Users of the Lightning
component should only be able to search for Contact records to which they have access.

Which two will restrict the records correctly?

Choose 2 answers

A. public with sharing class ContactController

C. public inherited sharing class ContactController

[0:23 pm, 11/10/2021] Raja❤: 61 of 65. A developer identifies the following triggers on the
Expense_c object:

deleteExpense,

applyDefaultsToExpense,

validateExpenseUpdate:

The triggers process before delete, before insert, and before update events respectively.

Which two techniques should the developer implement to ensure trigger best practices are
followed?

Choose 2 answers

C. Create helper classes to execute the appropriate logic when a record is saved.

D. Unify all three triggers in a single trigger on the Expense object that includes all events.

[0:24 pm, 11/10/2021] Raja❤: 62 of 65. Example 1:


AggregateResult() groupedResults (SELECT Campaignid, AVG (Amount) FROM Opportunity GROUP
BY

Campaignid];

for (AggregateResult ar groupedResulta)

System.debug('Campaign ID-az-get('Campaignid'11: Systen.debug (Average amount


+ar.get'expr0¹));

Example 21

AggregateResult[] groupedResults - [SELECT Campaignid. AVG (Amount) theAverage FROM


Opportunity

GROUP BY Campaignid);

for (AggregateResult ar: groupedResulta)

System.debug('Campaign ID + aziget(Campangnid Systen.debug('Average amount


+ar.getheverage'));

AggregateResult | groupedResults (SELECT Campaignto, AVG (Amount! FROM Opportunity GROUP


BY

Which two examples above use the System.debug statements to correctly display the results from
the SOQL aggregate queries?

Choose 2 answers

B. Example 2

C. Example 3

[0:25 pm, 11/10/2021] Raja❤: 63 of 65. A team of many developers work in their own individual
orgs that have the same configuration as the production org.

Which type of org is best suited for this scenario?

A. Developer Sandbox

[0:26 pm, 11/10/2021] Raja❤: 64 of 65. 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?

C. Schema.sObjectType.Account.isDeletable ()

65 of 65. 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?

Answer:

D. @Test Setup

You might also like