Consider the Apex controller below, that is called from an Aura component.
What is wrong with this code?
A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and 5P3 {created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls 2 roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a Funtime error occurs.
Why does the developer receive a runtime error?
The Account object has a field, Audit_Code_c, that is used to specify what type of auditing the Account needs and a Lookup to User, zudizar_c, that is the assigned auditor. When an Account is initially created, the user specifies the Audit_Code c. Each User in the org has a unique text field, Audit_Code _e, that is used to automatically assign the correct user to the Account’s Auditor_c field.
What should be changed to most optimize the code’s efficiency?
Choose 2 answers
Refer to the test method below:
The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?
Universal Containers uses Salesforce to track orders in an order__c object.
The order = object has private organization-wide defaults. The order = object
has a custom field, Quality_Controller_c, that is a Lookup to User and is used
to indicate that the specified User is performing quality control on the order_ co.
What should be used to automatically give read only access to the User set in the
Quality_Controller field?
A developer is asked to find a way to store sacret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?
Recently, users notice that fields that were recently added for one department suddenly disappear without warning.
Which two statements are true regarding these issues and resolution?
Choose 2 answers
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?
Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page.
What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?
Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.
What is the appropriate publish/subscribe logic to meet this requirement?
In an organization that has multi-currency enabled, a developer Is tasked with building a Lighting component that displays the top ten Opportunities most recently accessed by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.
What is the most effective approach to ensure values displayed respect the user's locale settings?
A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?
Universal Containers stores user preferences in a hierarchy custom setting,
user Prefs_c, with a checkbox field, show _help co. Company-level defaults are
stored at the organizational level, but may be overridden at the user level. If a user
has not overridden preferences, then the defaults should be used.
How should the show_Help_ c preference be retrieved for the current user?
A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:
How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?
Which tag should a developer use to display different text while an
A company wants to incorporate a third-party weh service to set the Address fields
when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact.
Assuming the Name field exists, how should the developer do this?
Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users, Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business,
One of the requirements is to allow certain community users within the same
Account hierarchy to see several departments’ containers, based on a custom
junction object that relates the Contact to the various Account records that
represent the departments.
Which solution solves these requirements?
A Lightning web component exists in the system and displays information about the record in context as a medal. Salesforce administrators need to use this component
within the Lightning App Builder,
Which two settings should the developer configure within the xml resource file?
Choose 2 answers
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?
Business rules require a Contact ta always be created when a new Account is created.
What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?
A company has many different unit test methods that create Account records as
part of their data setup. A new required field was added to the Account and now all
of the unit tests fail.
What is the optimal way for a developer to fix the issue?
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.
When a user changes the value in the industry select list, the table of Accounts
should be automatically updated to show the Accounts associated with the selected
industry,
What is the optimal way to implement this?
An Apex trigger creates an order co record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal technique for 2 developer to troubleshoot this?
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 page throws an ‘Attempt to dereference a null object’ error for a Contact.
What change in the controller will fix the error?
A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called survey Response c do not belong to a list of blocked domains.
The list of blocked domains is stored in a custom object for ease of maintenance by users. The survey Response c object is populated via a custom Visualforce page.
What is the optimal way to implement this?
Universal Containers develops a Salesforce application that requires frequent interaction with an external REST API.
To avoid duplicating code and improve maintainability, how should they implement the APL integration for code reuse?
For compliance purposes, a company is required to track long-term product usage in their org. The information that they need to log will be collected from more than one object and, over time, they predict they will have hundreds of millions of records.
What should a developer use to implement this?
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date
field on the Opportunity's Account whenever an Opportunity is closed. In the test
class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?
Refer to the following code snippet:
A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain criteria are met.
Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?
Choose 3 answers
A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.
What can a developer use to analyze and diagnose the problem in the Lightning page?
Consider the following code snippet:
The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly.
Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result set?
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.
What should the developer ensure to correct these errors?
A developer is trying to access org data from within a test class.
Which sObject type requires the test class to have the (seeAllData=true)
annotation?
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?
An Apex trigger creates a Contract record every time an Opportunity record is
marked as Closed and Won. This trigger is working great, except (due to a recent
acquisition) historical Opportunity records need to be loaded into the Salesforce
instance.
When a test batch of records are loaded, the Apex trigger creates Contract records.
A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
‘What is the most extendable way to update the Apex trigger to accomplish this?
Refer to the Aura component below:
A developer receives complaints that the component loads slowly.
Which change can the developer implement to make the component perform faster?
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?
A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes.
Which tool or mechanism should be utilized for managing the source-driven deployment process?
Universal Containers is using a custom Salesforce application to manage customer
support cases. The support team needs to collaborate with external partners to
resolve certain cases. However, they want to control the visibility and access to the
cases shared with the external partners. Which Salesforce feature can help achieve this requirement?
Consider the queries in the options below and the following Information:
* For these queries, assume that there are more than 200,000 Account records.
* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.
* There are two fields that are marked as External Id on the
Account. These fields are customer_Number_c and ERR_Key_ s.
Which two queries are optimized for large data volumes?
Choose 2 answers
Consider the controller code below that is called from an Aura component and
returns data wrapped in a class.
The developer verified that the queries return a single record each and there is error handling in the Aura component, but the component is not getting anything back when calling the controller getSemeData.
‘What is wrong?
Refer to the Lightning component below:
The Lightning Component allows users to click a button to save their changes and then redirects them to a different page.
Currently when the user hits the Save button, the records are getting saved, but they are not redirected.
Which three techniques can a developer use to debug the JavaScript?
Choose 3 answers