Which scenario is valid for execution by unit tests?
Which code statement includes an Apex method named updateAccounts in the class AccountController for use in a Lightning web component?
A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class.
Which code segment shows the correct declaration of the class and methods?
A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing
them to test isolated requirements for various types of Salesforce cases.
Which approach can efficiently generate the required data for each unit test?
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
If Apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which two statements are true regarding governor limits?
Choose 2 answers
A developer must perform a complex SOQL query that joins two objects in a Lightning component.
How can the Lightning component execute the query?
Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
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?
Universal Hiring uses Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the master object, to Application_c acting as the detail.
Within the Job__c object, a custom multi-select picklist, preferred _Locations__c, contains a list of approved states for the position. Each Job_Application__c record relates to a Contact within the system through a master-detail relationship.
Recruiters have requested the ability to view whether the Contact's Mailing State value matches a value selected on the Preferred Locations__c field, within the Job_Application__c record. Recruiters would like this value to be kept in sync if changes occur to the Contact's Mailing State.
What is the recommended tool a developer should use to meet the business requirement?
Which two actions may cause triggers to fire?
Choose 2 answers
Consider the following code snippet:
apex
CopyEdit
public class with sharing AccountsController {
@AuraEnabled
public List
return [SELECT Id, Name, Industry FROM Account];
}
}
Apex Test Class Snippet:
apex
CopyEdit
@isTest
private class with sharing AccountsController_Test {
@testSetup
private static void makeData(){
User user1 = [SELECT Id FROM User WHERE Profile.Name = 'System Administrator' AND isActive = true LIMIT 1];
User user2 = [SELECT Id FROM User WHERE Profile.Name = 'Standard User' AND UserName = 'test@test.com' AND isActive = true LIMIT 1];
TestUtils.insertAccounts(10, user1.Id);
TestUtils.insertAccounts(20, user2.Id);
}
@isTest
private static void getAllAccounts_StandardUser_Test(){
List
System.assertEquals(20, result.size());
}
}
When the test class runs, the assertion fails.
Which change should the developer implement in the Apex test method to ensure the test method executes successfully?
A developer is integrating with a legacy on-premise SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?
The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records:
Which governor limit will likely be exceeded within the Apex transaction?
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?
A credit card company needs to implement the functionality for a service agent to process damaged or stolen credit cards. When the customers call in, the service
agent must gather many pieces of information. A developer is tasked to implement this functionality.
What should the developer use to satisfy this requirement in the most efficient manner?
(Full question statement)
Which statement generates a list ofLeadsandContactsthat have a field containing the phrase "ACME"?
Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation.
What would be the best solution for this requirement?
Universal Containers decided to transition from Classic to Lightning Experience. They asked a developer to replace a JavaScript button that was being used to create records with prepopulated values.
What can the developer use to accomplish this?
Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 3 answers.
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?
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 done to ensure that a user populates the Lead Source field prior to converting a Lead?
A developer is migrating a Visualforce page into a Lightning web component.
The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.
Which security consideration should the developer be aware of?
A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code?
Choose 2 answers
Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine-tuned and provides a seamless user experience.
What are some benefits of using the Lightning Component framework?
Which three data types can a SOQL query return?
Choose 3 answers
Which two characteristics are true for Lightning Web Component custom events?
Choose 2 answers
A company's engineering department is conducting a month-long test on the scalability of an in-house-developed software that requires a cluster of 100 or more servers. Which of the following models is the best to use?
A developer deployed a trigger to update the status__c of Assets related to an Account when the Account’s status changes and a nightly integration that updates Accounts in bulk has started to fail with limit failures.
What should the developer change about the code to address the failure while still having the code update all of the Assets correctly?
Developers at Universal Containers (UC) use version control to share their code changes, but they notice that when they deploy their code to different environments they often have failures. They decide to set up Continuous Integration (CI).
What should the UC development team use to automatically run tests as part of their CI process?
Universal Containers is building a recruiting app with an Applicant object that stores information about an individual person and a Job
object that represents a job. Each applicant may apply for more than one job.
What should a developer implement to represent that an applicant has applied for a job?
A developer has identified 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
A company has a custom object, order __c, that has a required, unique external ID field called order Number__c.
Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of Order __c records
using the external ID field?
When the code executes, a DML exception is thrown.
How should a developer modify the code to ensure exceptions are handled gracefully?
What is a benefit of developing applications
Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name.
What is the best solution to assign the case to the appropriate support representative?
What is an example of a polymorphic lookup field in Salesforce?
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
A developer is creating an app that contains multiple Lightning web components.
One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page.
How should this be accomplished?
How should a developer write unit tests for a private method in an Apex class?
Which annotation exposes an Apex class as a RESTful web service?
A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.
Which two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?
Choose 2 answers
What should be used to create scratch orgs?
When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?
What should a developer do to check the code coverage of a class after running all tests?
What are two ways for a developer to execute tests in an org?
Choose 2 answers
Universal Containers (UC) uses out-of-the-box order management, that has a Master-Detail relationship between Order and Order Line Item.
UC stores the availability date on each Order Line Item and Orders are only shipped when all of the Order Line Items are available.
Which method should be used to calculate the estimated ship date for an Order?
Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?
A lead developer creates an Apex interface called Laptop.
Consider the following code snippet:
apex
CopyEdit
public class SilverLaptop {
// code implementation
}
How can a developer use the Laptop interface within the SilverLaptop class?
What is the result of the following code snippet?
public word doWork(Account acct) {
for (Integer i = 0; i <= 2007 i++) {
insert acct;
}
What can be used to override the Account's standard Edit button for Lightning Experience?
A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message ‘Maximum trigger depth exceeded’.
What could be the possible causes?
A developer needs to allow users to complete a form on an Account record that will create a record for a custom object.
The form needs to display different fields depending on the user’s job role, The functionality should only be available to a small group of users.
Which three things should the developer do to satisfy these requirements?
Choose 3 answers
Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage.
How should a developer accomplish this?
Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1, 000,000. A developer created the following trigger on the Account object to satisfy this requirement.
for (Account a : Trigger.new) {
if (a.AnnualRevenue > 1000000) {
List
if (oppList.size() == 0) {
Opportunity oppty = new Opportunity(Name = a.Name, StageName = 'Prospecting', CloseDate = System.today().addDays(30));
insert oppty;
}
}
}
Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, it fails with system, Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2. answers
A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes.
The following code is executed in the Developer Console using the Execute Anonymous window:
How many total accounts will be in the org after this code is executed?
Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.
When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page.
What can the developer use to meet this business requirement?
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.
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 so.
What is a possible reason that this change was not permitted?
A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an
OrderlItem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.
What should a developer do to allow their code to move some existing OrderItem records to a new Order record?
What is the value of the Trigger.old context variable in a before insert trigger?
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?