2
2
2
Q1. 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?
Q2. Universal Containers wants Opportunities to no longer be editable when reaching the
Closed/Won stage. How should a developer accomplish this?
Q3. While working in a sandbox, an Apex test fails when run in the Test Framework. However,
running the Apex test logic in the Execute Anonymous window succeeds with no exceptions or
errors.
Why did the method fail in the sandbox test framework but succeed in the Developer Console?
Q4. A recursive transaction is initiated by a DML statement creating records for these two objects:
• Accounts
• Contacts
A. The transaction succeeds as long as the Contact trigger stack depth is less than or equal to
16.
B. The transaction fails and ail the changes are rolled back.
C. The transaction is partially committed up until the stack depth is exceeded.
D. The transaction succeeds and all changes are committed to the database.
Q7. Given the following code snippet, that is part of a custom controller for a Visualforce page:
thisContact.Is_Active__c=false;
try{
update thisContact;
} catch(Exception e) {
String errorMessage = ‘An error occurred while updating the contact, ‘+e.getMessage()}
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL.errorMessage))
In which two ways can the try/catch be enclosed to enforce object and field-level permissions and
prevent the DML statement from being executed if the current logged-in user does not have the
appropriate level of access?
Choose 2 answers
Q9. 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?
Q10. In the following example, which sharing context will myMethod execute when it is invoked?
Q11. A developer created a new trigger that inserts a Task when a new Lead is created. After
deploying to production, an outside integration is periodically reporting errors.
Which change should the developer make to ensure the integration is not affected with minimal
impact to business logic?
Q12. Which two are best practices when it comes to Aura component and application event
handling?
Q13. 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 controllers=”Notice__c,myControllerExtension”
B. apex:page controller=”Notice__c” extensions=”myControllerExtension”
C. apex:page standardcontroller=”Notice__c” extensions=”myControllerExtension”
D. apex:page=Notice extends=”myControllerExtension”
Q14. What should a developer do to check the code coverage of a class after running all tests?
A. View the Code Coverage column in the view on the Apex Classes page.
B. View the Class Test Percentage tab on the Apex Class list view in Salesforce Setup.
C. View the Code Coverage percentage for the class using the Overall Code Coverage panel in
the Developer Console Tests tab.
D. Select and run the class on the Apex Test Execution page in the Developer Console.
Q15. Which process automation should be used to send an outbound message without using Apex
code?
A. Workflow Rule
B. Process Builder
C. Strategy Builder
D. Flow Builder
Q16. A developer has a single custom controller class that works with a Visualforce Wizard to
support creating and editing multiple subjects. The wizard accepts data from user inputs across
multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers
Q17. A developer needs to prevent the creation of request_c records when certain conditions exist
in the system. A RequestLogic class exists to checks the conditions. What is the correct
implementation?
Q18. 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.
Choose 2 answers
Q19. A developer must create a ShippingCaleulator class that cannot be instantiated and must
include a working default implementation of a calculate method, that sub-classes can override.
Q20. Which statement describes the execution order when triggers are associated to the same
object and event?
Choose 3 answers
A. Apex Class
B. Visualforce
C. Apex Trigger
D. User
E. Process Builder
Q22. Since Aura application events follow the traditional publish-subscribe model, which method is
used to fire an event?
A. fire()
B. emit()
C. registerEvent()
D. fireEvent()
Q23. 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
A. standard Controller
B. extensions
C. renderAs
D. readOnly
E. Action
Q24. A developer wants to invoke an outbound message when a record meets a specific criterion.
Which three features satisfy this use case?
Choose 3 answers
A. Approval Process has the capability to check the record criteria and send an outbound
message without Apex code.
B. Next Best Action can be used to check the record criteria and send an outbound message.
C. Flow Builder can be used to check the record criteria and send an outbound message.
D. Process Builder can be used to check the record criteria and send an outbound message
without Apex code.
Q25. 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.
What should be built to implement this feature?
A. Account Custom trigger.
B. Account approval process.
C. Account assignment rule.
D. Account workflow rule..
A. @RestResource
B. @RemoteAction
C. @HttpInvocable
D. @AuraEnabled
Q27. A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an
entire suite of test allowing them to test independent requirements various types of Salesforce
Cases.
Which approach can efficiently generate the required data for each unit test?
Q28. 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?
A. Write a trigger on the child object and use a red-black tree sorting to sum the amount for all
related child objects under the Opportunity.
B. Write a Process Builder that links the custom object to the Opportunity.
C. Write a trigger on the child object and use an aggregate function to sum the amount for all
related child objects under the Opportunity.
D. Use the Streaming API to create real-time roll-up summaries.
Q30. 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
detail page. Example values are as follows:
• Name
• Amount
• Account
Which two methods should the developer implement to fulfill the business requirement?
Choose 2 answers
A. Create a Process Builder on the Opportunity object that executes an Apex immediate action
to perform the HTTP REST callout whenever the Opportunity is updated.
B. Create an after update trigger on the Opportunity object that calls a helper method using
@Future(Callout=true) to perform the HTTP REST callout.
C. 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 page.
A. CalloutException
B. LimitException
C. NoAccessException
D. A Custom Exception
Q32. A developer writes a trigger on the Account object on the before update event that increments
a count field. A workflow rule also increments the count field every time that an Account is created
or updated. The field update in the workflow rule is configured to not re-evaluate workflow rules.
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?
A. 2
B. 3
C. 1
D. 4
The developer receives deployment errors every time a deployment is attempted from Sandbox to
Production.
Q35. 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 variables to ensure their value can only be assigned
one time?
Choose 2 answers
A. Use the final keyword and assign its value in the class constructor.
B. Use the static keyword and assign its value in the class constructor.
C. Use the final keyword and assign its value when declaring the variable.
D. Use the static keyword and assign its value in a static initializer.
Q36. 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.
Q37. A developer created these three Rollup Summary fields in the custom object, Project__c.:
Total_Timesheets__c
Total_Approved_Timesheets__c
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 request?
Choose 2 answers
Q38. 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?
A. Create the Picklist on each object as a required field and select “Display values
alphabetically, not in the order entered”
B. Create the Picklist on each object and use a Global Picklist Value Set containing the values.
C. Create the Picklist on each object and select “Restrict picklist to the values defined in the
value set”.
D. Create the Picklist on each object and add a validation rule to ensure data integrity
Q39. A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages
are rendering on the page.
Which component should be added to the Visualforce page to display the message?
A. <apex:pageMessages />
B. <apex:pageMessage severity="info" />
C. <apex:facet name="messages" />
D. <apex:message for="info"/>
Q40. Example 1:
Example 2:
Example 3:
Example 4:
Which two examples above use the System.debug statements to correctly display the results from
the SOQL aggregate queries?
Choose 2 answers
A. Example 1
B. Example 2
C. Example 3
D. Example 4
Database.insert(a, false);
A. The record will not be created and an exception will be thrown.
B. The record will be created and a message will be in the debug log.
C. The record will be created and no error will be reported.
D. The record will not be created and no error will be reported.
Q42. A team of developers is working on a source-driven project that allows them to work
independently, with many different org configurations.
Which type of Salesforce orgs should they use for their development?
A. Developer orgs
B. Full Copy sandboxes
C. Scratch orgs
D. Developer sandboxes
Q43. 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?
A. String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get(‘url_param’))
B. ApexPages.currentPage().getParameters().get(‘url_param’).escapeHtml4()
C. String.ValueOf(ApexPages.currentPage().getParameters().get(‘url_param’))
D. ApexPages.currentPage().getParameters().get(‘url_param’)
Q44. Which three statements are true regarding custom exceptions in Apex?
Choose 3 answers
Q45. 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.
A. Since this only involves sending emails, no publishing is necessary. Have the external system
subscribe to the BatchApexError event.
B. Publish the error event using the addError() method and write a trigger to subscribe to the
event and notify the external system.
C. Publish the error event using the addError() method and have the external system subscribe
to the event using CometD.
D. Publish the error event using the Eventbus.publish() method and have the external system
subscribe to the event using CometD.
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:
A. Unify all three triggers in a single trigger on the Expense_c object that includes all events.
B. Maintain all three triggers on the Expense_c object, but move the Apex logic out of the
trigger definition.
C. Unify the before insert and before update triggers and use Process Builder for the delete
action.
D. Create helper classes to execute the appropriate logic when a record is saved.
Q47. A developer is creating a Visualforce page that allows users to create multiple Opportunities.
The developer is asked to verify the current user's default Opportunity record type, and set certain
default values based on the record type before inserting the record. How can the developer find the
current user's default record type?
A. Query the Profile where the ID equals userInfo.getProfileID() and then use the
profile.Opportunity.getDefaultRecordType() method.
B. Use Opportunity.SObjectType.getDescribe().getRecordTypeInfos() to get a list of record
types, and iterate trought them until isdefaultRecordTypeMapping() is true.
C. Use the Schema.userInfo.Opportunity.getDefaultRecordType() method.
D. Create the opportunity and check the opportunity.recordType before inserting, which will
have the record ID of the current user's default record type
Q48. Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers
Q49. 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?
A. @InvocableMethod
{ /*implementation*/ }
B. @InvocableMethod
{ /*implementation*/ }
C. @InvocableMethod
{ /*implementation*/ }
D. @InvocableMethod
{ /*implementation*/ }
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?
A. Full Sandbox
B. Developer Edition
C. Partner Developer Edition
D. Developer Sandbox
Q53. What are two ways for a developer to execute tests in an org?
Choose 2 answers
A. Bulk API
B. Developer Console
C. Tooling API
D. Metadata API
Q54. A developer must modify the following code snippet to prevent the number of SOQL queries
issued from exceeding the platform governor limit.
The above method might be called during a trigger execution via a Lightning component.
A. Refactor the code above to perform only one SOQL query, filtering by the Set of
opportunityIds.
B. Use the System.Limits.getlimitQueries() method to ensure the number of queries is less
than 100.
C. Refector the code above to perform the SOQL query only if the Set of opportunityIds
contains less 100 Ids.
D. Use the System.Limits.getQueries() method to ensure the number of queries is less than
100.
A. Workbench
B. Salesforce CLI
C. Developer Console
D. Sandbox refresh
Boolean isOK;
Integer x;
X=1;
X=2;
X=3;
} else {
X = 4;
A. 1
B. 3
C. 4
D. 2
Q57. Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if
real-time notification is not required?
Q58. Universal Containers has large number of custom applications that were built using a third-
party javaScript framework and exposed using Visualforce pages. The Company wants to update
these applications to apply styling that resembles the look and feel of Lightning Experience. What
should the developer do to fulfill the business request in the quickest and most effective manner?
A. Enable Available for Lightning Experience, Lightning Comminities, and the mobile app on
Visualforce pages used by the custom application.
B. Set the attribute enableLightning to treu in the definition.
C. Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript
applications.
D. Rewrite all Visualforce pages asLightning components.
Q59. 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
additional information?
A. @InvocableMethod(Label='additional Info')
public ContactInfo(Id contactId)
{ /*implementation*/ }
B. @InvocableMethod(label='Additional Info')
public List<ContactInfo> getInfo(List<Id> contactIds)
{ /*implementation*/ }
C. @InvocableMethod(label='additional Info')
public static ContactInfo getInfo(Id contactId)
{ /*implementation*/ }
D. @invocableMethod(label)='Additional Info')
public static List<ContactInfo> getInfo(List<Id> contactIds)
{ /*Implementation*/ }
Q60. 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 == ‘Technology’) {
thisAccount.Is_Tech_c = true;
}
update thisAccount;
}
When the code executes, what happens as a result of the Apex transaction?
A. If executed in a synchronous context, the apex transaction is likely to fall by exceeding the
DHL governor limit.
B. The Apex transaction succeeds regardless of any uncaught exception and all processed
accounts are updated.
C. The Apex transaction fails with the following message. "SObject row was retrieved via SOQL
without querying the requested field Account.Is_Tech__c”.
D. If executed in an asynchronous context, the apex transaction is likely to fall by exceeding the
DML governor limit
Q61. 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
A. Triggers
B. Process Builder
C. Roll-up summaries
D. Relationships
E. Custom objects and fields
Q62. 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.