Platform Developer-I WI 22: Very Important For WI22 Exam

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45
At a glance
Powered by AI
The document discusses platform developer exam questions and answers related to Apex, Visualforce, Lightning components, and more. Key topics include controller extensions, data import tools, multi-tenant environments, and relationships.

A controller extension can be specified using apex:page standardController and extensions attributes or apex:page controller and extensions attributes.

Data Loader Wizard does not support importing Opportunity records.

Platform Developer-I WI

22

Very important for WI22 exam

Que 1. What are two ways that a controller extension can be specified on a visualforce page?

Choose 2 answers

Apex:page standardController=”Account” extensions=”myControllerExtension”

Apex:page controller=”Account” extensions =”myControllerExtension”

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

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

Data Import Wizard does not support Opportunities.

Que 3. What is a benefit of developing applications in a multi-tenant environment?

Default out-of-the-box configuration.

Que 4. Which three Salesforce resources can be accessed from a Lightning web component?

Choose 3 answers

Content asset files

SVG resources

Static resources
Que 5 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

Que 6. 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 succeed and changes will be committed.

Que 7. A developer has a Visualforce page and custom controller to save Account records. The
developer wants to display any validation rule violations to the user.

How can the developer make sure that validation rule violations are displayed?
Include <apex:messages> on the Visualforce page.

Que 8. Which two are phases in the Salesforce Application Event propagation framework?

Choose 2 answers

Bubble

Default

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

Choose 2 answers

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

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

Que 10. What is the result of the following code?

Account a = new Account();

Database.insert(a, false);

The record will not be created and an exception will be thrown.

Que 11. 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
are not allowed to see the Line Items on the Order.

Which type of relationship should be used?


Lookup

Que 12. 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

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

Dev Hub

Que 14. An org tracks customers orders on an Order object and the line items of an Order on the Line
Item object. The Line Item object has a Master/Detail relationship to the Order object. A developer
has a requirement to calculate the order amount on an Order and the line amount on each Line Item
based on quantity and price.

What is the correct implementation?

Implement the line amount as a currency field and the order amount as a SUM formula field.

Que 15. Flow Builder uses an Apex Action to provide additional information about multiple
Contacts, stored in a custom class, ContactInfo.

Which is the correct definition of the Apex method that gets the additional information?

@InvocableMethod(label=’Additional Info’)

Public static List<ContactInfo> getInfo(List<Id> contactIds)


( /*implementation*/)

Que 16. 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 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’];

Que 17. The Sales management team at Universal Containers requires that the Lead Source field of
the Lead record be populated when a Lead is converted.

What should be used to ensure that a user populates the Lead Source field prior to converting a Lead?

Validation Rule

Que 18. What is the result of the following code snippet?

Public void dowork(Account acct){

For(Integer i=0;i<=200; i++){

Insert acct;

0 Accounts are inserted.


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

By providing device-awareness for mobile and desktops.

Que 20. 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 definitions of a Lightning Web Component property that uses the getAccounts
method?

@wire{ getAccounts, (searchTerm: ‘$searchTerm’) }

accountList;

Que 21. What will be the output in the debug log in the event of a QueryException during a call to
the Query method in the following example?
Querying Accounts, Query Exception, Done.

Que 22. While writing an Apex class that creates Accounts, a developer wants to make sure that all
required fields are handled properly.

Which approach should the developer use to be sure that the Apex class works correctly?

Include a try/catch block to the Apex class.

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

Converting Leads to Person accounts or Contact accounts.


Que 24. Universal Containers wants Opportunities to be locked from editing when reaching the
Closed/Won stage.

Which two strategies should a developer use to accomplish this?

Choose 2 answers

Use a validation rule.

Use a trigger.

Que 25. 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.

Que 26. Given the following trigger implementation:

The developer receives deployment errors every time a deployment is attempted from Sandbox to
Production.

What should the developer do to ensure a successfull deployment?


Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components.

Que 27. Which scenario is valid for execution by unit tests?

Set the created date of a record using a system method.

Que 28. 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 can extend other classes besides the Exception class.

A custom exception class must extend the system Exception class.

Que 29. 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 fulfil the business request in the quickest and most effective
manner?

Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript
applications.

Que 30. 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 systems based on a user-initiated actions on the Opportunity
detail page. Example values are as follows:
 Name
 Amount
 Account

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

Choose 2 answers

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

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

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

<apex:outputText escape-“false” value=”{!$CurrentPage.parameters.userInput}” />

Que 32. For which three items can a trace flag be configured?

Choose 3 answers

User

Apex Trigger

Apex Class

Que 33. A developer at Universal Containers is tasked with implementing a new Salesforce
application that will be maintained completely by their company’s Salesforce administrator.

Which three options should be considered for building out the business logic layer of the application?

Choose 3 answers
Validation Rules

Process Builder

Flow Builder

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

Which method allows access to the price book?

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

Que 35. A developer is tasked to perform a security review of the ContactSearch Apex class that exists
in the system. Within the class, the developer identifies the following method as a security threat.

CD

Que 36. 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?

Ant Migration Tool

SFDX CLI
Que 37. A developer is implementing an Apex class for a financial system. Within the class, 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 variable to ensure their value can only be assigned
one time?

Use the static keyword and assign its value in the class constructor.

Use the final keyword and assign its value when declaring the variable.

Que 38. A developer wants to mark each Account in a List<Account> as either Active or Inactive
based on the LastModifiedDate field value being more than 90 days.

Which Apex techniques should the developer use?

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

Que 39. Universal container decided it will not send emails to support personnel directly for salesforce
in the event that an unhandled exceptions occurs. Instead UC wants an external system to be notified
of the error.

What is the appropriate publish/subscribe logic to meet these requirements?

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

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

Full Sandbox
Que 41. How can a developer check the test coverage of active process Builders and Flows before
deploying them in a Change Set?

Use SOQL and the Tooling API.

Que 42. Refer to the following code snippet for an environment has more than 200 Accounts
belonging to the Technology industry :

For(Account thisAccount : [Select Id, Industry FROM Account Limit 150]) {

If(thisAccount.Industry = = ‘Techonogy’){

thisAccount.Is_Tech c = true;

Update thisAccount;

When the code executes, which two events occur as a result of the Apex transaction?

Choose 2 answers

The Apex transaction succeeds regardless of any uncaught exception and all processed
accounts are updated.

The Apex transaction fails with the following message: “SObject row was retrieved via SOQL
without querying the requested field: Account.Is_Tech c”.
Que 43. A developer is creating a page that allows users to create multiple opportunities. The
developer is asked to verify the current users default opportunity record type and set certain default
values based on the record type before inserting the record.

Use Opportunity.SObjectType.getDescribe().getRecordTypeInfos()to get a list of record types


and interate through them until isDefaultRecordTypeMapping() is true.

Que 44. Which code should be used to update an existing visualforce page that uses standard
visualforce component so that the page matches the look and feel of lightning experience?

<Apex: page lightningStylesheets=’true’>

Que 45. Which three data types can a SOQL query return?

Choose 3 answers

List

sObject

Integer

Que 46. A developer writes a trigger on the account object on the before update event that increments
count field. A workflow rule also increments that count field every time an Acocunt is created or
updated. The field update in the workflow rule is configured to not to re-evaluate workflow rule.

What is the value of the count field if an Account is inserted with an initial value of zero, assuming no
other automation logic is implemented on the Account?

Ans: 2

Que 47. A developer wants to invoke an outbound message when a record meets a specific criteria.
BCE

Que 48. Which two statements accurately represent the MVC framework implementation in
salesforce?

Triggers used to create records represent the Model (M) part of the MVC framework.

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

Que 49. 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*/}

Que 50. Assuming that ‘Name’ is a string obtained by an <apex : inputText> tag on a visualforce page
which Two SOQL queries performed are safe from SOQL injection.

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

Workflow Rule

Que 52. What are two ways for a developer to execute tests in an org?

Developer Console

Tooling API

Que 53. Universal container wants a list button to display a visualforce page that allows users to edit
multiple records which visualforce feature supports this requirement.

Ans: Recordsetvar page attribute

Que 54. Which three web technologies can be integrated into a visualforce page?

CSS

JavaScript

HTML

Que 55. A developer must modify the following code snippet to prevent the number of SOQL queries
issued from exceeding the platform governor limit.
C

Que 56. A developer needs to create a custom interface in Apex:

Which three considerations must developer keep in mind while developing the apex interface.

Ans:

ADE

Que 57. The following Apex method is part of the contactService class that is called from a trigger:
Ans : A

Que 58. A SSN c custom field exists on the candidate c custom object. The field is used to store
each candidate’s social security number and is marked as unique in the schema definition.

Ans : D
Que 59. 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

Que 60. What is a fundamental difference between a master detail relationship and a lookup
relationship.

Ans: A Master detail relationship detail record inherits the sharing and security of its master
record.

Que 61. A developer writes a single trigger on the Account object on the after insert and after updates
events. A workflow rule modifies a field every time an Account is created or updated.

Ans : 2

Que 62. A developer must implement a checkpaymentprocessor class that provides check processing
payment capabilities that adhere to what is defines for payments in the payment Processor Interface.

Public interface PaymentProcessor {

Valid pay(Dacimal amount);

Public class CheckPaymentProcessor implements PaymentProcessor {

Public void pay (Decimal amount) {}

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

Add a new Create Records element.

Que 64. 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.

Ans : C

Que 65. A developer wrote Apex code that calls out to an external systems.

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

Write a class that implements the HTTPCalloutMock Interface.

Que 66. Which two statements are true about using the @testSetup annotation in an Apex test class?

The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is


used.

The @testSetup method is automatically executed before each test method in the test class is
executed. Or
A method defined with the @testSetup annotation executes once for each test method in the test
class and counts towards system limits.

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

Choose 3 answers

<apex:includeLightning/>

$Lightning.use

$Lightning.createComponent

Que 68. What is the maximum number of SOQL queries used by the following code?

List<Account> aList =[ SELECT Id FROM Account LIMIT 5];

For(Account a : aList){

List<Contact> cList = [Select id from contact where AccountId =:a.ID];

Ans : 6

Que 69. 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);

Que 70. 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 customCtrlr{

private Account theAccount;

public String actType;

public customCtrlr(){

theAccount = (SELECT Id, Type FROM Account WHERE Id


=:ApexPages.currentPage().getParameters().get('id')};

actType = theAccount.Type;

Visualforce page snippet:

The Account Type is {!actType}

The value of the account type field is not being displayed correctly on thepage. Assuming the custom
controller is properly referenced on the Visualforcepage, what should the developer do to correct the
problem?

Add a getter method for the actType attribute.

Que 71. 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

Unify all three triggers in a single trigger on the Expense c object that includes all events.
Create helper classes to execute the appropriate logic when a record is saved.

Que 72. Given the following code snippet, that is part of a custom controller for a Visualforce page:

Ans :

Use if (Schema. sObjectType.Contact.fields.Is_Active c.isUpdateable())

Use if(Schema.sObjectType.Contact.isUpdatable())

Que 73. 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 on other automation
logic is implemented on the Account?

Ans : 2

Que 74. 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;
}

Ans : 0

Que 75. How does the Lightning Component framework help developer implements solutions faster?

Ans : By providing device-awareness for mobile and desktops.

Que 76. In terms of the MVC paradigm, what are two advantages of implementing the view layer of
a Salesforce application using Lightning Web Component-based development over visualforce?

Choose 2 answers

Self-contained and reusable units of an application


Rich component ecosystem

Que 77. When importing and exporting data into Salesforce, which two statements are true?

Choose 2 answers

Ans: Developer and Developer Pro sandboxes have different storage limits.

Bulk API can be used to import large data volumes in development environments without
bypassing the storage limits.

Que 78. 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 c custom object.

How should a developer implement this feature?

Build an Account custom Trigger.


Que 79. Universal Containers stores the availability date on each Line Item of an Order and Orders
are only shipped when all of the Line Items are available.

Which method should be used to calculate the estimated ship date for an Order?

Use a Max Roll-Up Summary field on the latest availability date fields.

Que 80. 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.

Que 81. 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?

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

Que 82. A developer is debugging the following code to determine why accounts are not being
created.
Account a =new account(name= 'a');
database.insert(a,false);

How should the code be altered to help debug the issue?

Add a try/catch around the insert method


Que 83. A developer needs to confirm that a Contact trigger works correctly without changing the
organizations data. What should the developer do to test the Contact trigger?

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

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

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


Global.
2. Only one method using the @InvocableMethod annotation can be defined per Apex
class.
3. A method using the @InvocableMethod annotation must be declared as static.

Que 85. 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?

String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get('url_param’))

Que 86. A developer uses a loop to check each Contact in a list. When a Contact with the Title of
"Boss" is found, the Apex method should jump to the first line of code outside of the for
loop.
Which Apex solution will let the developer implement this requirement?

Ans : break;

Que 87. Which two events need to happen when deploying to a production org?
Choose 2 answers

1. All triggers must have at least 1% test coverage.


2. All Apex code must have at least 75% test coverage.
Que 88. What is a capability of the <ltng:require> tag that is used for loading external Javascript
libraries in Lightning Component?

Choose 3 answers

One-time loading for duplicate scripts.

Specifying loading order.

Loading scripts in parallel.

Que 89. What are three characteristics of change set deployments?

They require a deployment connection.

They can be used only between related organizations.

They can be used to transfer records.

Que 90. 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, ExtensionB”>

<apex:commandButton action =”{!save}” value=”Save”/>

</apex:page>

A. Runtime error will be generated

B. Standard controller save()

C. ExtensionB save()
D. ExtensionA save()

Que 91. A developer has a single custom controller class that works with a Visualforce Wizard to
support creating and editing multiple sObjects.
The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter
on the initial URL
Which statement is unnecessary inside the unit test for the custom controller?

ApexPage.currentPage().getParameters().put(‘Input’,’TestValue’);

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

Test.setCurrentPage(pageRef),

Que 92. A developer created this Apex trigger that calls MyClass.myStaticMethod:

trigger myTrigger on Contact(before insert)

{ MyClass.myStaticMethod(trigger.new, trigger.oldMap); }

The developer creates a test class with a test method that calls MyClass.myStaticMethod, resulting in
81% overall code coverage.
What happens when the developer tries to deploy the trigger and two classes to production, assuming
no other code exists?

Ans: The deployment fails because the Avex trigger has no code coverage.

Que 93. Which two statements are valid regarding Apex classes and interfaces?

Choose 2 answers

A class can only have one inner class level.


Inner classes are private by default.

Que 94. Which two statements are true about Getter and Setter methods?

Choose 2 answers

Setter methods are required to pass a value from a page to a controller.

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

Que 95. Which three statements are accurate about debug logs?

Choose 3 answers

A. To View Debug Logs, “Manager users” or “View All Data” permission is needed.

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

C. Debug Log levels are cumulative, where FINE log level includes all events logged at the
DEBUG, INFO, WARN, and ERROR levels.

D. To view Debug Logs, “Manager Users” or Modify All Data” permission is needed.

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

Que 96. 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 c record, all the
Expense_Item 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 c records when the criteria is met.
Que 97. How should a developer write unit tests for a private method in an Apex class ?

Use the TestVisible annotation.

Que 98. 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

Public inherited sharing class ContactController

Public with sharing class ContactController

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

The WhatId field on the Standard Event object.

Que 100. A developer wants to retrieve the Contacts and Users with the email address
[email protected]’.

Which SOSL statement should the developer use?

FIND ([email protected]) IN Email Fields RETURNING Contact (Email), User(Email)

Que 101. 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?

Mark the field as Required on the field definition.

Que 102. 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.

Que 103. 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.

Que 104. A developer needs to prevent the creation of Request c records when certain conditions
exist in the system. A RequestLogic class exists that checks the conditions.

What is the correct implementation?

trigger RequestTrigger on Request c (before insert){


RequestLogic.validateRecords (trigger.new);
}

Que 105. Application Events follow the traditional publish-subscribe model.


Which method is used to fire an event?
Fire()
Que 106. Which statement describes the execution order when triggers are associated to the same
object and event?
Trigger execution order cannot be guaranteed.

*** Que 107. A Licensed_Professional c custom object exists in the system with two Master-Detail
fields for the following objects : Certification c and Contact.
Users with the “Certification Representative” role can access the Certification records they own and
view the related Licensed Professionals records, however users with the “Sales Representative” role
report they cannot view any Licensed Professional records even though they own the associated
contact record.
What are two likely causes of users in the “Sales Representative” role not being able to access the
Licensed Professional records?

The organization has a private sharing model for Certification c, and Contact is the primary
relationship in the Licensed_Professional c object.
The organization has a private sharing model for Certification c, and Certification c is the
primary relationship in the Licensed_Professional c object.

Que 108. 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

*** Que 109. 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 application when developing customizations outside the ISV’s
package namespace.
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.

Que 110. What should be used to create scratch orgs?


Salesforce CLI

Que 111. 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

Que 112. 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?
VS Code / SFDX CLI
Ant Migration tool

*** Que 113. 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 c custom object.
How can a developer implement this feature?
A. Build an Account Assignment Rule.
B. Build a Workflow Rule.
C. Build an Account Approval Process.
D. Build a Flow with Flow Builder.

Q 114. 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?
Define a Data Export scheduled job.

Q 115. Which exception type cannot be caught?


LimitException

Que 116. 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

Que 117. 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.

Que 118. 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?
@AuraEnabled (Cacheable=true)
Public static List<Opportunity> search (String term) { /*implementation*/ }

*** Que 118. Refer to the following code that runs in an Execute Anonymous block:
For(List<Lead> theseLeads : [Select LastName, Company, Email From Lead LIMIT 20000]) {
For(Lead thisLead : theseLeads){
If(thisLead.Email = = null)
thisLead.Email = assignGenericEmail(thisLead.LastName, thisLead.company);
}
Database.update(theseLeads, false);
}

If an environment where the full result set is returned, What is a possible outcome of this code?

The total number of DML statements issued will be exceeded.


Que 119. Which aspect of Apex Programming is limited due to multitenancy?
The number of records returned from database queries.

Que 120. 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?

Use the schema describe calls to determine if the logged-in user has access to the Account
object.

Que 121. 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.

Que 122. 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 a Before Update trigger and accessing the field value from Trigger.new

Que 123. A developer needs to create a custom button for the Account object that, when clicked, will
perform a series of calculation and redirect the user to a custom Visualforce page.
Which three attributes need to be defined with values in the <apex:page> tag to accomplish this?
Choose 3 answers
standardController
action
renderAs

Que 124. 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.isDeletable()

Que 125. A developer considers the following snippet of code:

Boolean isOK;
Integer x;
String theString =’Hello’;
If (isOK = = false && theString = = ‘Hello’) {
x = 1;
} else if (isOK = = true && theString = = ‘Hello’) {
x = 2;
} else if (isOK != null && theString = = ‘Hello’) {
x = 3;
} else {
x = 4;
}

Based on this code What is the value of x?

Ans : 4
Que 126. 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.

Que 127. 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() mrthod.

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

Que 128. A developer has to identify a method in an Apex class that performs resource intensive
actions in memory by iterating over the result set of a SOQL statement on the account. The method
also performs a DML 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 limits?
Choose 2 answers.
Use the Database.Savepoint method to enforce database integrity.

Use the System.Limit class to monitor the current CPU governor limit consumption.
Que 129. 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.

Que 130. Universal Containers decides to use purely declarative development to build out a new
Salesforce application.
Which three options can be used to build out the business logic layer for this application?
Choose 3 answers
Flow Builder
Validation Rules
Process builder

Que 131. Which two characteristics are true for Aura component events?
Choose 2 answers
Calling event.stopPropagation() may or may not stop the event propagation based of the
current propagation phase.
The event propagates to every owner in the containment hierarchy.

Que 132. What can be developed using the Lightning Component framework?
Single-page web apps

Que 133. A developer needs to join data received from an integration with an external system with
parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records,
but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the
Salesforce ID?
Create a custom field on the child object of type Lookup.

Que 134. A PrimaryId c custom field exist 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 environment 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.

Que 135. Universal Containers hires a developer to build a custom search page to help users finf 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
SOSL is faster for text searches.
SOQL is able to return more records.

Que 136. What is the value of the Trigger.old context variable in a Before Insert trigger?
Ans : null

Que 137. A custom object Trainer c has a lookup field to another custom object Gym c.
Which SOQL query will get the record for the Viridian City gym and all it’s trainers?
SELECT Id, (SELECT Id FROM Trainers r) FROM Gym c WHERE Name = ‘Viridian
City Gym’

Que 138. Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object
has a Master-Detail relationship with the standard Accounts 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.
What is a possible reason that this change was not permitted?
The Account records contain Vendor roll-up summary fields.

Que 139. What should a developer do to check the code coverage of a class after running all tests?
View the Class Test Coverage tab on the Apex Class record in Salesforce Setup.

Que 140. 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>

Que 141. An org tracks customer orders on an Order object and the line items of an Order on the Line
Item object. The Line Item object has a Master/Details to the Order object. A developer has a
requirement to calculate the order amount on an Order and the line amount on each Line Item based
on quantity.
What is the correct implementation?
Implement the line amount as a numeric formula field and the order amount as a roll-up
summary field.

Que 142. 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

Que 143. Which two statements accurately represent the MVC framework implementation in
salesforce?

Records created or updated by triggers represent the Model (M) part of the MVC framework.
Validation rules enforce business rules and represent the Controller (C) part of the MVC
framework.

Que 144. A recursive transaction is initiated by a DML ststement 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 changes are committed to the database.

Que 145. Universal Containers uses a Master-Detail relationship and stores the availability date on
each Line Item of an Order and Orders are only shipped when all of the Line Items are available.

Which method should be used to calculate the estimated ship date for an Order ?

Use a Max Roll-UP Summary field on the latest availability date fields.

Que 146. Given the code below:

List<Account> aList = [Select Id From Account];

For(Account a : aList){

List<Contact> cList = [ Select Id From Contact Where AccountId = :a.Id];

What should a developer do to correct the code so that there is no chance of hitting a governor limit?
Add a LIMIT clause to the first Select SOQL Statement.

Que 147. Which three resources in an Aura Component can contain Javascript functions?

Choose 3 answers

Controller

Helper

Renderer

Que 148. Which action may cause triggers to fire?

Updates to Feed Items

Que 149. Which three steps allow a custom SVG to be included a Lightning Web Component?

Choose 3 answers

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

Reference the getter in the HTML template.

Upload the SVG as a static resource.

Que 150. Where are two locations a developer can look to find information about the status of
asynchronous or future calls?

Apex Flex Queue

Apex Jobs
Que 151. 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 logic to meet these requirements?

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

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

What are two characteristics of declarative development over programmatic customization?

Chhose 2 answers

Declarative development can be done using the Setup UI.

Declarative development does not require Apex test classes.

Que 153. 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”?

FIND ‘Universal Containers’ IN Name Fields RETURNING lead(Id, Name), account(Id, Name),
contact(Id, Name)

Que 154. Universal Containers (UC) wants to lower its shipping cost while making the shipping
process more efficient. The 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”.

Which field should the developer add to create the most efficient model that supports the business
need?

Add a Master-Detail field on the Global Address object to the Account object.

Que 155. What does the Lightning Component framework provide to developers?

Prebuilt components that can be reused.

You might also like