Instead of waiting to send emails to support personnel directly from the finish
method of a batch Apex 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 this requirement?
B
Explanation:
Use BatchApexErrorEvent for notifications. It's automatically triggered for unhandled exceptions in
batch Apex. No need for manual publishing. External systems can subscribe to this event to receive
notifications.
Reference: Batch Apex
A developer is asked to develop a new AppFxchange application. A feature of the program creates
Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature
needs to be configurable, as different Salesforce instances require Surveys at different times.
Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings
that apply to
most customers.
What should the developer use to store and package the custom configuration settings for the app?
C
Explanation:
Custom metadata is best for storing configurable settings. It's deployable, packageable, and
upgradeable. Allows different configurations for different instances.
Reference: Custom Metadata Types
A user receives the generic "An internal server error has occurred” while interacting
with a custom Lightning component.
What should the developer do to ensure a more meaningful message?
D
Explanation:
Use AuraHandledException in try-catch for custom errors. It enables sending meaningful, user-
friendly error messages to the Lightning component.
Reference: Handling Errors in Lightning Components
Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript
and C55 files. They want to ensure efficient loading and caching of the page.
Which feature should be utilized to achieve this goal?
C
Explanation:
Static resources are ideal for efficient loading and caching of external files in Visualforce. They allow
bundling and minimizing HTTP requests.
Reference: Using Static Resources
A company manages information about their product offerings in custom objects named Catalog and
Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many
as 100,000 Catalog Items.
Both custom objects have a CurrencylsoCode text field that contains the currency
code they should use. If a Catalog's CurrencylsoCode changes, all of its Catalog
Items’ CurrencylsoCodes should be changed as well.
What should a developer use to update the CurrencylsoCodes on the Catalog Items
when the Catalog's CurrencylsoCode changes?
A
Explanation:
Use Database.Batchable for handling large data sets. It can efficiently process 100,000 Catalog Items
asynchronously and update CurrencylsoCodes.
Reference: Using Batch Apex
How should a developer assert that a trigger with an asynchronous process has successfully run?
D
Explanation:
Use Test.startTest() and Test.stopTest(). These methods ensure asynchronous code runs within test
execution and allows for accurate assertions.
Reference: Testing Asynchronous Apex
A company notices that their unit tests in a test class with many methods to create many records for
prerequisite reference data are slow.
What can a developer to do address the issue?
C
Explanation:
@testSetup method improves test performance. It allows data sharing across test methods within a
class, reducing redundant data creation.
Reference: Using the testSetup Method
Universal Containers implements a private sharing model for the Convention Attendee co custom
object. As part of a new quality assurance effort, the company created an Event_Reviewer_c user
lookup field on the object.
Management wants the event reviewer to automatically gain ReadWrite access to
every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?
B
Explanation:
Use Apex Managed Sharing with an after insert trigger. It allows dynamic record sharing based on
user-defined criteria like the Event_Reviewer_c field.
Reference: Apex Managed Sharing
Consider the following code snippet:
How should the <e-orders> component communicate to the <c-selected-orders
component that an order has been selected by the user?
D
Explanation:
Create and dispatch a custom event. This approach allows LWC components to communicate
effectively, maintaining component encapsulation and reusability.
Reference: Communicating Between Lightning Web Components
A developer is creating a Lightning web component to display a calendar. The component will be
used in multiple countries. In some locales, the first day of the week is a Monday, or a Saturday, or a
Sunday. ‘What should the developer do to ensure the calendar displays accurately for users in every
locale?
B
Explanation:
Use the @salesforce/i18n module with the firstDayOfWeek property. It provides locale-aware
functionality essential for internationalization.
Reference: Internationalization with Lightning Web Components
Which statement is considered a best practice for writing bulk safe Apex triggers?
A
Explanation:
Bulk-safe triggers use collections to aggregate DML operations. This practice minimizes the number
of DML statements, which is essential for bulk processing.
Reference: Apex Developer Guide - Bulk Trigger Best Practices
As part of their quoting and ordering process, a company needs to send POFs to their document
storage system's REST endpoint that supports OAuth 2.0. Each Salesforce user must be individually
authenticated with the document storage system to send the PDF.
What is the optimal way for a developer to implement the authentication to the REST endpoint?
A
Explanation:
Named Credentials with OAuth handle secure API calls. Individual authentication for each user with
OAuth 2.0 is managed through Named Credentials.
Reference: Named Credentials as Callout Endpoints
What is the optimal way to fix this?
A)
B)
C)
D)
C
Explanation:
Test.startTest() and Test.stopTest() should wrap the method call for resource allocation.
Test.setMock() sets a mock callout for the test to handle callouts.
Reference: Apex Developer Guide - Testing HTTP Callouts
Refer to the test method below''
The test method calls a web service that updates an external system with Account
information and sets the Accounts integration_Updated__c checkbox to True when it completes.
The test fails to execute and exits with an error: "Methods defined as TestMethod do
not support Web service callouts.”
A)
B)
C)
D)
B
Explanation:
The correct order in tests with callouts is Test.startTest(), then Test.setMock(), followed by the
method invocation, and finally Test.stopTest(). This ensures the mock callout is used.
Reference: Apex Developer Guide - Testing HTTP Callouts
Refer to the following code snippets:
A developer is experiencing issues with a Lightning web component. The component must surface
information about Opportunities owned by the currently logged-in user.
When the component is rendered, the following message is displayed: "Error retrieving data”.
Which modification should be implemented to the Apex class to overcome the issue?
A
Explanation:
The @AuraEnabled(cacheable=true) attribute allows caching of method results on the client side,
reducing server trips for already fetched data, which is useful for read-only data.
Reference: Aura Components Developer Guide - AuraEnabled Annotation