Dev Cert Flashcards
1 - Refer to the following Apex code:
Integer x = 0;
do {
x = 1;
x++;
}while (x<1);
System.debug(x);
What is the value of x when it is written to the debug log?
A. 0
B. 1
C. 2
D. 3
C
2 - 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<Opportunity> opplist = (SELECT Id FROM Opportunity WHERE accountId = :a. Id];
if (opplist.size() == 0) {
Opportunity oppty = new Opportunity (Name = a.name, StageName = ‘Prospecting’,</Opportunity>
ClogeDate = 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. Move the DML that saves opportunities outside of the for loop.
B. Query for existing opportunities outside of the for loop.
C. Use Database. query to query the opportunities.
D. Check if all the required fields for Opportunity are being added on creation.
A and B
3 - What are two use cases for executing Anonymous Apex code?
Choose 2 answers
A. To run a batch Apex class to update all Contacts
B. To schedule an Apex class to run periodically
C. To add unit test code coverage to an org
D. To delete 15,000 inactive Accounts in a single transaction after a deployment
B and D
4 - A software company uses the following objects and relationships:
● Case: to handle customer support issues
● Defect c: a custom object to represent known issues with the company’s software
● Case Defect c: a junction object between Case and Defect o to represent that a defect is a cause of a customer issue
Case and Defect__c have Private organization-wide defaults.
What should be done to share a specific Case_Defect__c record with a user?
A. Share the parent Defect_c record.
B. Share the parent Case and Defect__c records.
C. Share the Case_Defect__ c record.
D. Share the parent Case record.
B
5 - 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
A. Create a static resource containing test data.
B. Use the @isTest (seeAllData=true) annotation in the test class
C. Use the @isTest (iParallel=true) annotation in the test class
D. Use Test.loadData to populate data in your test methods.
A and D
6 - A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search.
Consider the following code snippet:
@AuraEnabled
public static Ligt<List<sObject>> searchTerms(List<String> termList) {
List‹List<sObject>> result = new List <List<sObject>> ();
for (String term : termList){
regult.addAll([FIND :term IN ALL FIELDS RETURNING Account (Name),</sObject></sObject></String></sObject>
Contact (FirstName, LastName) ]) ;
}
return result;
}
What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?
A. 20
B. 150
C. 200
D. 2,000
D
7 - A developer creates a Lightning web component that imports a method within an Apex class. When a Validate button is pressed, the method runs to execute complex validations.
In this implementation scenario, which artifact is part of the Controller according to the MVC architecture?
A. HTML file
B. XML file
C. JavaScript file
D. Apex class
D
8 - A developer is creating a Lightning web component to show a list of sales records. The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field.
How should this be enforced so that the component works for both users without showing any errors?
A. Use Security. stripInaccessible to remove fields inaccessible to the current user.
B. Use Lightning Data Service to get the collection of sales records.
C. Use WITH SECURITY_ENFORCED in the SQL that fetches the data for the component.
D. Use Lightning Locker Service to enforce sharing rules and field-level security.
A
9 - AW Computing (AWC) handles orders in Salesforce and stores its product inventory in a field, Inventory__c, on a custom object, Product__c. When an order for a Product__c is placed, the Inventory__c field is reduced by the quantity of the order using an Apex trigger.
public void reduceInventory (Id prodid, Integer gty){
Integer newInventoryAmt = getNewInventoryAmt (prodId, qty) ;
Product__c = new Product__c(Id = prodId, Inventory__c = newInventoryAmt;
Uptade p;
// code goes here
}
AWC wants the real-time inventory reduction for a product to be sent to many of its external systems, including some future systems the company is currently planning.
What should a developer add to the code at the placeholder to meet these requirements?
A. InventoryReductionEvent__c ev = new InventoryReductionEvent__c (ProductId__c = prodId, Reduction__c = qty);
EventBus.publish (ev);
B. InventoryReductionEvent__e ev = new InventoryReductionEvent__e (ProductId__c = prodId, Reduction__c = qty);
insert ev;
C. InventoryReductionEvent__c ev = new InventoryReductionEvent__c (ProductId__c = prodId, Reduction__c = qty);
insert ev;
D. InventoryReductionEvent__e ev = new InventoryReductionEvent__e (ProductId__c = prodId, Reduction__c = qty);
EventBus.publish (ev);
D
10 -The OrderHelper class is a utility class that contains business logic for processing orders. Consider the following code
snippet:
public class without sharing OrderHelper{
//code implementation
}
A developer needs to create a constant named DELIVERY_MULTIPLIER with a value of 4.15. The value of the
constant should not change at any time in the code.
How should the developer declare the DELIVERY MULTIPLIER constant to meet the business objectives?
A. decimal DELIVERY MULTIPLIER=4.15;
B. static decimal DELIVERY MULTIPLIER=4.15;
C. constant decimal DELIVERY MULTIPLIER = 4.15:
D. static final decimal DELIVERY MULTIPLIER =4.15;
D
11 - A developer is asked to create a Visualforce page that lists the contacts owned by the current user. This component will be embedded in a Lightning page. Without writing unnecessary code, which controller should be used for this purpose?
A. Standard list controller
B. Custom controller
C. Lightning controller
D. Standard controller
A
12 - Which two sfdx commands can be used to add testing data to a Developer sandbox?
Choose 2 answers
A. force:data:tree:import
B. force:data:object:create
C. force:data:bulk:upsert
D. force:data:async:upsert
A and C
13 -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?
A. Add a try/catch around the insert method.
B. Add a System.debug() statement before the insert method.
C. Set the second insert method parameter to TRUE.
D. Collect the insert method return value in a SaveResult record.
D
14 - An org has two custom objects:
● Plan__c, that has a master-detail relationship to the Account object
● Plan_Item__c, that has a master-detail relationship to the Plan__c object
What should a developer use to create a Visualforce section on the Account page layout that displays all of the Plan__c records related to the Account and all of the Plan_Item__c records related to those Plan__c records.
A. A custom controller by itself
B. A standard controller with a controller extension
C. A standard controller with a custom controller
D. A controller extension with a custom controller
B
15 - A third-party vendor created an unmanaged Lightning web component. The Salesforce Administrator wishes to expose the component only on Record Page Layouts.
Which two actions should the developer take to accomplish this business objective?
Choose 2 answers
A. Ensure isExposed is set to true on the XML file.
B. Specify lightning__RecordPage as a target in the XML file.
C. Specify lightningCommunicy__Page_Layout as a target in the XML file.
D. Specify lightningCommunity__Page as a target in the XML file.
A and B
16 - AW Computing tracks order information in custom objects called Order__c and Order_Line__c. Currently, all shipping information is stored in the Order__c object. The company wants to expand its order application to support split shipments so that any number of Order_Line__c records on a single Order__c can be shipped to different locations.
What should a developer add to fulfill this requirement?
A. Order_Shipment_Group__c object and master-detail field on Order_Line__c
B. Order_ Shipment_Group__c object and master-detail fields to Order__c and Order_Line__c
C. Order Shipment_ Group_ c object and master-detail field on Order__c
D. Order Shipment Group__c object and master-detail field on Order_Shipment_Group__c
B
17 - Which annotation exposes an Apex class as a RESTful web service?
A. @RestResource
B. @AuraEnabled
C. @HttpInvocable
D. @RemoteAction
A
18 - Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering_ Support__c Users should be able to associate multiple Engineering_support__c records to a single Opportunity record.
Additionally, aggregate information about the Engineering_ Support__c records should be shown on the Opportunity record.
What should a developer implement to support these requirements?
A. Lookup field from Opportunity to Engineering_ support__c
B. Master-detail field from Opportunity to Engineering_ support__c
C. Lookup field from Engineering_Support__c to Opportunity
D. Master-detail field from Engineering_ support__c to Opportunity
B
19 - A developer wrote Apex code that calls out to an external system.
How should a developer write the test to provide test coverage?
A. Write a class that implements the HTTPCalloutMock.
B. Write a class that implements WebserviceMock.
C. Write a class that extends WebserviceMock.
D. Write a class that extends HTTPCalloutMock.
A
20 - A developer created this Apex trigger that calls MyClass.myStaticMethod:
trigger myTrigger on Contact (before insert)
{ MyClass.myStaticMethod(trigger.new); }
The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, 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?
A. The deployment passes because both classes and the trigger were included in the deployment.
B. The deployment fails because the Apex trigger has no code coverage.
C. The deployment passes because the Apex code has the required >75% code coverage.
D. The deployment fails because no assertions were made in the test method.
B
21 - A developer created a Lightning web component called statusComponent to be inserted into the Account record page.
Which two things should the developer do to make this component available?
Choose 2 answers
A. Add <target>lighening\_\_ RecordPage</target> to the statusComponent.js-meta.xml file.
B. Add <isExposed>true</isExposed> to the statusComponent.js-meta.xml file.
A. C.Add <masterLabel>Account</masterLabel> to the statusCompoment.js-meta.xml file.
C. Add <target>lightning RecordPage</target> to the statusComponent.js file.
A and B
22 - Which two settings must be defined in order to update a record of a junction object?
Choose 2 answers
A. Read/Write access on the primary relationship
B. Read/Write access on the secondary relationship
C. Read access on the primary relationship
D. Read/Write access on the junction object
A and B
23 - Universal Containers uses Service Cloud with a custom field, Stage__c, on the Case object.
Management wants to send a follow-up email reminder 6 hours after the Stage__c field is set to “Waiting on Customer”. The Salesforce Administrator wants to ensure the solution used is bulk safe.
Which two automation tools should a developer recommend to meet these business requirements?
A. Scheduled Flow
B. Record-Triggered Flow
C. Einstein Next Best Action
D. Entitlement Process
A
24 - 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. Implement pagination with a StandardSetController.
B. Use JavaScript remoting with SOQL Offset.
C. Implement pagination with an OffsetController.
D. Use lazy loading and a transient List variable.
D
25 - The code below deserializes input into a list of Accounts.
01 public class AcctCreator {
02 public void insertAccounts() {
03 String acctsJson = getAccountsJson();
04 List<Account>accts = (List<Account>) JSON.deserialize(acctsJson,
List<Account>.class);
05
06 // DML to insert accounts
07 }
08 // ... other code including getAccountJson implementation
09 }</Account></Account></Account>
Which code modification should be made to insert the Accounts so that field-level security is respected?
A. 01: public with sharing class AcctCreator
B. 05: if (s0bjectType.Account.isCreatable())
C. 05: accts = Database.stripInaccessible(accts, Database.CREATABLE);
D. 05: sObjectAccessDecision sd = Security.stripInaccessible (AccessType.CREATABLE, accts);
A
26 - A developer completed modifications to a customized feature that is comprised of two elements:
● Apex trigger
● Trigger handler Apex class
What are two factors that the developer must take into account to properly deploy the modification to the
production environment?
Choose 2 answers
A. All methods in the test classes must use @isTest.
B. At least one line of code must be executed for the Apex trigger.
C. Test methods must be declared with the testMethod keyword.
D. Apex classes must have at least 75% code coverage org-wide.
A and D
27 - A developer has a requirement to write Apex code to update a large number of account records on a nightly basis.
The system administrator needs to be able to schedule the class to run after business hours on an as-needed basis.
Which class definition should be used to successfully implement this requirement?
A. global inherited sharing class ProcesAccountProcessor implements Database.Batchable<sObject>, Schedulable
B. global inherited sharing class ProceegAccountProcessor implements Queueable
C. global inherited sharing class ProceegAccountProceessor implements Database.Batchable<sObject>
D. global inherited sharing class ProcessAccountProcessor implements Schedulable</sObject></sObject>
D
28 - A Salesforce Administrator used Flow Builder to create a flow named “accountOnboarding”. The flow must be used inside an Aura component.
Which tag should a developer use to display the flow in the component?
A. aura: flow
B. aura-flow
C. lightning-flow
D. lightning: flow
D
29 - 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/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?
A. Implement the line amount as a currency field and the order amount as a SUM formula field.
B. Write a single before trigger on the Line Item that calculates the item amount and updates the order amount
on the Order.
C. Implement the line amount as a numeric formula field and the order amount as a roll-up summary field.
D. Write a process on the Line Item that calculates the item amount and order amount and updates the fields on
the Line Item and the Order.
C
30 - Which two characteristics are true for Aura component events?
Choose 2 answers
A. By default, containers can handle events thrown by components they contain.
B. If a container component needs to handle a component event, add a includeFacetga”true attribute to its handler.
C. The event propagates to every owner in the containment hierarchy.
D. Depending on the current propagation phase, calling event. stopPropagation() may not stop the event propagation.
C and D
31 - A developer is tasked with performing a complex validation using Apex as part of advanced business logic. When certain criteria are met for a PurchaseOrder, the developer must throw a custom exception.
What is the correct way for the developer to declare a class that can be used as an exception?
A. public class PurchaseOrder extends Exception{}
B. public class PurchaseOrder implements Exception{}
C. public class PurchaseOrderException implements Exception{}
D. public class PurchaseOrderException extends Exception{}
A
32 - A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to execute a complex validation involving several types of objects.
When creating the Apex method, which annotation should a developer use to ensure the method can be used
within the flow?
A. @AuraEnabled
B. @future
C. @InvocableMethod
D. @RemoteAction
C
33 - Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
A. Database.insert(records, false)
B. insert (records, false)
C. Database .insert (records, true)
D. insert records
A
34 - The Salesforce Administrator created a custom picklist field, Account_Status__c, on the Account object. This picklist has possible values of “Inactive” and “Active”. As part of a new business process, management wants to ensure an opportunity record is created only for Accounts marked as Active. A developer is asked to implement this business requirement.
Which automation tools should be used to fulfill the business need?
A. Salesforce Flow
B. Approval Process
C. Outbound Messaging
D. Entitlement process
A
35 - Considering the following code snippet:
public static void insertAccounts(List<Account> theseAccounts){
for (Account ThisAccount : theseAccounts){
if (this.Account.website == null){
thisAccount.website='https://www.demo.com';
}
}
update theseAccounts;
}
When the code executes, a DML exception is thrown.</Account>
How should the developer modify the code to ensure exceptions are handled gracefully?
A. Implement the upsert: DML statement.
B. Implement Change Data Capture.
C. Implement a try/catch block for the DML.
D. Remove null items from the list of Accounts.
C
36 - A developer receives an error when trying to call a global server-side method using the @remoteAction decorator.
How can the developer resolve the error?
A. Add static to the server-side method signature.
B. Decorate the server-side method with (static=false).
C. Decorate the server-side method with (static=true).
D. Change the function signature to be private static.
A
37 - The following automations already exist on the Account object:
● A workflow rule that updates a field when a certain criteria is met
● A custom validation on a field
● A flow that updates related contact records
A developer created a trigger on the Account object.
What should the developer consider while testing the trigger code?
A. The flow may be launched multiple times.
B. A workflow rule field update will cause the custom validation to run again.
C. The trigger may fire multiple times during a transaction.
D. Workflow rules will fire only after the trigger has committed all ML operations to the database.
C
38 - Cloud Kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls. At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen.
What should a developer use to satisfy this requirement?
A. An outbound message
B. An Apex REST class
C. An invocable method
D. An Apex controller
B
39 - 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. Lightning Data Service ignores field-level security.
B. The with sharing keyword must be used to enforce sharing rules.
C. The isAccessible() method must be used for field-level access checks.
D. Lightning Data Service handles sharing rules and field-level security.
D
40 - A developer wrote the following two classes:
public with sharing class StatueFetcher {
private Boolean active = true;
private Boolean isActive() {
return active;
}
}
public with sharing class Calculator {
public void deCalculations () {
StatusFetcher fetcher = new StatusFetcher ();
İf(sFetcher.isActive()) {
//do calculations here
}
}
}
The StatusFetcher class successfully compiled and saved. However, the Calculator class has a compile time error.
How should the developer fix this code?
A. Make the is active method in the statusFetcher class public.
B. Change the class declaration for the Calculator class to public with inherited sharing.
C. Make the doCalculations method in the Calculator class private.
D. Change the class declaration for the StatusFetcher class to public with inherited sharing.
A
41 - Get Cloudy Consulting (GCC) has a multitude of servers that host its customers’ websites. GCC wants to provide a servers status page that is always on display in its call center. It should update in real time with any changes made to any servers. To accommodate this on the server side, a developer created a Server Update platform event.
The developer is working on a Lightning web component to display the information.
What should be added to the Lightning web component to allow the developer to interact with the Server Update platform event?
A. import ( subscribe, unsubscribe, onError ) from ‘lightning/MeggageChannel’
B. import ( subscribe, unsubscribe, onError ) from ‘lightning/pubsub’
C. import ( subscribe, unsubscribe, onError )from ‘lightning/empApi’
D. import ( subscribe, unsubscribe, onError ) from ‘lightning/ServerUpdate
C
42 - 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?
A. Exception
B. Messaging
C. OrgLimits
D. Limits
D
43 - 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. Lookup field from Applicant to job
B. Junction object between Applicant and job
C. Formula field on Applicant that references Job
D. Master-detail field from Applicant to Job
B
44 - The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records:
@AuraEnabled
public void static updateLeads() {
for (Lead thislead : (SELECI Origin e FROM Lead]) !
thisLead. LeadSource = thisLead. Origin;
update thisLead;
}
}
Which governor limit will likely be exceeded within the Apex transaction?
A. Total number of records processed as a result of DML statements
B. Total number of records retrieved by SOQL queries
C. Total number of SOQL queries issued
D. Total number of DML statements issued
D
45 - What is the result of the following code?
Account a = new Account();
Database. insert (a, false);
A. The record will be created and a message will be in the debug log.
B. The record will not be created and no error will be reported.
C. The record will not be created and an exception will be thrown.
D. The record will be created and no error will be reported.
B
46 - A developer creates a custom exception as shown below:
public class ParityException extends Exception {}
What are two ways the developer can fire the exception in Apex?
Choose 2 answers
A. throw new ParityException (“parity does not match);
B. throw new ParityException () ;
C. new ParityException (‘parity does mop match’) ;
D. new ParityException() ;
A and B
47 - A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an OrderItem 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?
A. Change the master-detail relationship to an external lookup relationship.
B. Create a junction object between Orderltem and Order.
C. Select the Allow reparenting option on the master-detail relationship.
D. Add without sharing to the Apex class declaration.
B
48 - A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers
A. The parent component can use the Apex controller class to send data to the child component.
B. The parent component can use a public property to pass the data to the child component.
C. The parent component can invoke a method in the child component.
D. The parent component can use a custom event to pass the data to the child component.
B and C
49 - A developer created a weather app that contains multiple Lightning web components. One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component. When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the Temperature component so the temperature can be converted and displayed.
What is the recommended way to accomplish this?
A. Create a custom event to handle the communication between components.
B. Use an application event to communicate between the components.
C. The Toggle component should call a method in the Temperature component.
D. Use Lightning Message Service to communicate between the components.
A
50 - Universal Containers uses Salesforce to create orders.
When an order is created, it needs to sync with the in-house order fulfillment system. The order fulfillment system can accept S0AP messages over HTTPS. If the connection fails, messages should be retried for up to 24 hours.
What is the recommended approach to syne the orders in Salesforce with the order fulfillment system?
A. Set up a Workflow Rule outbound message to the order fulfillment system.
B. Create an after insert trigger on the Order object to make a callout to the order fulfillment system
C. Write an Apex SOAP service to integrate with the order fulfillment system.
D. Use Process Builder to call an invocable Apex method that sends a message to the order fulfillment system.
A
51 - Where are two locations a developer can look to find information about the status of batch or future methods?
Choose 2 answers
A. Apex Jobs
B. Time-Based Workflow Monitor
C. Apex Flex Queue
D. Paused Flow Interviews component
A and C
52 - What should a developer use to script the deployment and unit test execution as part of continuous integration?
A. Execute Anonymous
B. VS Code
C. Developer Console
D. Salesforce CLI
D
53 - A business implemented a gamification plan to encourage its customers to watch some educational videos.
Customers can watch videos over several days, and their progress is recorded. Award points are granted to customers for all completed videos. When the video is marked as completed in Salesforce, an external web service must be called so that points can be awarded to the user.
A developer implemented these requirements in the after update trigger by making a call to an external web service. However, a Syetem. CalloutException is occurring.
What should the developer do to fix this error?
A. Replace the after update trigger with a before insert trigger.
B. Surround the external call with a try-catch block to handle the exception.
C. Move the callout to an asynchronous method with @future( callout=true) annotation.
D. Write a REST service to integrate with the external web service.
C
54 - As part of a data cleanup strategy, AW Computing wants to proactively delete associated opportunity records when the related Account is deleted.
Which automation tool should be used to meet this business requirement?
A. Record-Triggered Flow
B. Workflow Rules
C. Scheduled job
D. Process Builder
A
55-Which scenario is valid for execution by unit tests?
A. Set the created date of a record using a system method.
B. Execute anonymous Apex as a different user.
C. Load data from a remote site with a callout.
D. Generate a Visualforce PDF with getContentAsPDF().
A
56 - Which three steps allow a custom scalable vector graphics (SVG) to be included in a Lightning web component?
A. Upload the SVG as a static resource.
B. Import the static resource and provide a variable for it in JavaScript.
C. Import the SVG as a content asset file.
D. Reference the import in the HTML template.
E. Reference the property in the HTML template.
A, B, and E
57 - A developer needs to have records with specific fleld values in order to test a new Apex class.
What should the developer do to ensure the data is avallable to the test?
A. Use Test.loadData () and reference a CSV file in a static resource.
B. Use Anonymous Apex to create the required data.
C. Use SOQL to query the org for the required data.
D. Use Test.loadData () and reference a JSON file in Documents.
A
58 - 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:
Account myAccount = new Account (Name = ‘MyAccount’);
İnsert myAccount;
Integer x = 1;
List(Account> newAccounts = new List<Account> ();
Do (
Account acct = new Account (Name = ‘New Account ‘ + xx++);
Newaccounts.add (acct) ;
) while (x < 10) ;
How many total accounts will be in the org after this code is executed?
A. 5
B. 6
C. 10
D. 15</Account>
D
59- Which two process automations can be used on their own to send Salesforce Outbound Message?
Choose 2 answers
A. Workflow Rule
B. Process Builder
C. Flow Builder
D. Strategy Builder
A and C
60 - 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
A. A formula field will trigger existing automation when deployed.
B. A formula field will calculate the value retroactively for existing records.
C. Using a formula field reduces maintenance overhead.
D. A test class that validates the formula field is needed for deployment.
B and D
61 - 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?
A. public abstract class ShippingCalculator {
public void calculate() (/implementation/)
}
B. public abstract class ShippingCalculator {
public override calculate() (/implementation/)
}
C. public abstract class ShippingCalculator {
public abstract calculate() (/implementation/)
}
D. public abstract class ShippingCalculator {
public virtual void calculate() (/implementation/)
}
D
62 - Which two statements are true aböut using the @testSetup annotation in an Apex test class?
Choose 2 answers
A. A method defined with the @testSetup annotation executes once for each test method in the lest class and
counts towards system limits.
B. In a test setup method, test data is Inserted once and made available for all test methods in the test class.
C. The @testSetup annotation is not supported when the @isTest(SeeAlIData = True) annotation is used.
D. Records created in the test setup method cannot be updated in individual test methods.
A and C
63 - Einstein Next Best Action is configured at Universal Containers to display recommendations to internal users on the Account detail page. If the recommendation is approved, a new opportunity record and task should be generated. If the recommendation is rejected, an Apex method must be executed to perform a callout to an external system.
Which three factors should a developer keep in mind when Implementing the Apex method?
Choose 3 answers
A. The method must be defined as static.
B. The method must use the @AuraEnabled annotation.
C. The method must use the @InvocableMethod annotation.
D. The method must be defined as public.
E. The method must use the @Future annotation.
A, D, and E
64 - 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.
A. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order.
B. Use a CEILING formula on each of the latest availability date fields.
C. Use a LATEST formula on each of the latest availability date fields.
D. Use a MAX Roll-Up Summary field on the latest availability date fields.
A
65 - What can be developed using the Lightning Component framework?
A. Salesforce integrations
B. Hosted web applications
C. Dynamic web sites
D. Single-page web apps
D
66 - 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?
A. Formula Field
B. Workflow Rule
C. Process Builder
D. Validation Rule
D
67 - Which code in a Visualforce page and/or controller might present a security vulnerability?
A. <apex: outputText value=”{!$CurrentPage.parameters,.userInput}” />
B. <apex: outputField value=” {!crtl.userInput}” />
C. <apex: outputText escape=”false” value=”{!$CurrentPage.parameters.userInput}” />
D. <apex:outputField escape=”false” values=”{!ctrl.userInput}” />
C
68- 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?
Choose 2 answers
A. SFDX CLI
B. VSCode
C. Developer Console
D. Change Sets
OR
A. Ant Migration Tool
B. Change Sets
C. SFDX CLI
D. Developer Console
A and B OR A and C
69 - 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?
A. public abstract class ShippingCalculator {
public void calculate() (/implementation/)
}
B. public abstract class ShippingCalculator {
public override calculate() (/implementation/)
}
C. public abstract class ShippingCalculator {
public abstract calculate() (/implementation/)
}
D. public abstract class ShippingCalculator {
public virtual void calculate() (/implementation/)
}
D
70 - 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 and use a Global Picklist Value Set containing the values.
B. Create the Picklist on each object as a required field and select “Display values alphabetically, not in
the order entered”.
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.
A
71 - A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit.
public without sharing class OpportunityService{
public static List<OpportunityLineItem> getOpportunityProducts (Set<Id> opportunityIds) {List<OpportunityLineItem> oppLineItems = new List<OpportunityLineItem>();
for(Id thisOppId : opportunityIds) {
oppLineItems.addAll ([SELECT Id FROM OpportunityLineItem WHERE OpportunityId = : thisOppId]);
}
return oppLineItems;
}
}</OpportunityLineItem></OpportunityLineItem></Id></OpportunityLineItem>
The above method might be called during a trigger execution via a Lightning component.
Which technique should be implemented to avoid reaching the governor limit?
A. Use the System.Limits.getLimitsQueries () method to ensure the number of queries is less than 100.
B. Refactor the code above to perform the SOQL query only if the Set of opportunityIds contains less 100
Ids.
C. Use the system.Limits.getQueries () method to ensure the number of queries is less than 100.
D. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds,
C
72 - 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. 1
C. 4
D. 3
A
73 - 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. The Vendor records have existing values in the Account object.
B. The Vendor object must use a Master-Detail field for reporting.
C. The Account object is included on a workflow on the Vendor object.
D. The Account records contain Vendor roll-up summary fields
D
74 - A developer needs to create a custom button for the Account object that, when clicked, will perform a series of calculations 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. renderAs
B. action
C. readOnly
D. standardController
E. extensions</apex:page>
B, D, and E
75 - Which exception type cannot be caught?
A. LimitException
B. A Custom Exception
C. NoAccessException
D. CalloutException
A
76 - Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers
A. Static resources
B. Content asset files
C. Third-party web components
D. All external libraries
E. SVG resources
A, D, and E
77 - 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?
A. SELECI Id, (SELECT Id FROM Trainers_r) FROM Gym_c WHERE Name = ‘Viridian City Gym’
B. SELECI Id, (SELECT Id FROM Trainers_c) FROM Gym_c WHERE Name = ‘Viridian City Gym’
C. SELECI Id, (SELECT Id FROM Trainer_r) FROM Gym_c WHERE Name = ‘Viridian City Gym’
D. SELECI Id, FROM Trainers__c WHERE gym__r.Name =‘Viridian City Gym’
B
78 - Instead of sending emails to support personnel directly from Salesforce, 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?
A. Since this only involves sending emails, no publishing is necessary. Have the external system subscribe to the BastcApecerror event.
B. Publish the error event using the addError () method and have the external system subscribe to the event using CometD.
C. Publish the error event using the Eventbus.publish () method and have the external system subscribe to the event using CometD.
D. Publish the error event using the addError () method and write a trigger to subscribe to the event and notify the external system.
C
79 - A developer is creating a 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()
togetalistofrecordtypes,and iterate through 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.
B
80 - What are two ways for a developer to execute tests in an org?
Choose 2 answers
A. Developer Console
B. Tooling API
C. Bulk API
D. Metadata API
B and D
81 - 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?
A. Use the Data Loader command line.
B. Create a Schedulable Apex class.
C. Schedule a report.
D. Define a Data Export scheduled job.
D
82 - 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
A. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction.
B. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction.
C. The Apex governor limits are reset for each iteration of the execute () method.
D. The Apex governor limits are omitted while calling the constructor of the Apex class.
C and D
83 - Which two events need to happen when deploying to a production org?
Choose 2 answers
A. All Apex code must have at least 75% test coverage.
B. All Visual Flows must have at least 1% test coverage.
C. All triggers must have some test coverage.
D. All Process Builder Processes must have at least 1% test coverage.
A and C
84 - 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?
A. Declare the class and method using the global access modifier.
B. Declare the class as global and use the public access modifier on the method.
C. Declare the class as public and use the global access modifier on the method.
D. Declare the class and method using the public access modifier.
A
85 - When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?
A. Sandbox
B. Environment Hub
C. Dev Hub
D. Production
C
86 - What is an example of a polymorphic lookup field in Salesforce?
A. The Whatld field on the standard Event object
B. A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign
C. The Leadid and ContactId fields on the standard Campaign Member object
D. The Parentid field on the standard Account object
A
87 - 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?
A. accountRec.sObjectType.isDeleteable()
B. Account. isDeletable()
C. accountRec.isDeletable()
D. Schema. sObjectType.Account.isDeletable()
D
88 - Which code displays the contents of a Visualforce page as a PDF?
A. <apex: page renderAs=”pdf”>
B. <apex: page renderA=”application/pdf”>
C. <apex: page contentType=”application/pdf”>
D. <apex: page contenttype=”pdf”>
A
89 - Which two types of process automation can be used to calculate the shipping cost for an Order when the Order is placed and apply a percentage of the shipping cost to some of the related Order Products?
Choose 2 answers
A. Workflow Rule
B. Flow Builder
C. Approval Process
D. Process Builder
B and D
90 - 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.</Account>
Which Apex technique should the developer use?
A. An if/else statement, with a for loop inside
B. A for loop, with a switch statement inside
C. A for loop, with an if-else statement inside
D. A switch statement, with a for loop inside
C
91 - 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 = aggignGenericEmail(thisLead.LastName, thislead.Company); } Database.Update (theseLeads, false);
In an environment where the full result set is returned, what is a possible outcome of this code?
A. The transaction will succeed and the first ten thousand records will be committed to the database.
B. The total number of records processed as a result of DML statements will be exceeded.
C. The transaction will succeed and the full result set changes will be committed to the database.
D. The total number of DML statements issued will be exceeded.
C
92 - What are three considerations when using the @InvocableMethod annotation in Apex?
Choose 3 answers
A. Only one method using the @InvocableMethod annotation can be defined per Apex class.
B. A method using the @InvocableMethod annotation can be declared as Public or Global.
C. A method using the @InvocableMethod annotation must be declared as static.
D. A method using the @InvocableMethod annotation can have multiple input parameters.
E. A method using the @InvocableMethod annotation must define a return value,
A, B, and C
93 - 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. webservice class WebServiceClass {
private Boolean helpMethod() {/*implementation . . . / }
global static String updateRecords() {/implementation . . . / }
}
B. global class WebServiceClass {
private Boolean helpMethod() {/implementation . . . / }
webservice static String updateRecords() {/implementation . . . / }
}
C. global class WebServiceClass {
private Boolean helpMethod() {/implementation . . . / }
global String updateRecords() {/implementation . . . / }
}
D. webservice class WebServiceClass {
private Boolean helpMethod() {/implementation . . . / }
webservice static String updateRecords() {/implementation . . . */ }
}
C
94 - While writing an Apex class that creates Accounts, a developer wants to make sure that all required fields are handled property.
Which approach should the developer use to be sure that the Apex class works correctly without adding or changing data in the org?
A. Run the code in an Execute Anonymous block in the Developer Console.
B. Create a test class to execute the business logic and run the test in the Developer Console.
C. Include a try/catch block to the Apex class.
D. Perform a code review with another developer.
B
95 - How should a custom user interface be provided when a user edits an Account in Lightning Experience?
A. Override the Account’s Edit button with a Lightning page.
B. Override the Account’s Edit button with a Lightning Flow.
C. Override the Account’s Edit button with a Lightning component.
D. Override the Account’s Edit button with a Lightning Action.
C
96 - Universal Containers wants Opportunities to no longer be editable when reaches the Closed/Won stage.
Which two strategies can a developer use to accomplish this?
A. Use a validation rule.
B. Use a trigger
C. Use an after-save flow.
D. Use the Process Automation settings.
A and B
97 - 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. Self-contained and reusable units of an application
B. Automatic code generation
C. Server-side run-time debugging
D. Rich component ecosystem
A and D
98 - 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 getAccounte method?
A. @AuraEnable(getAccounts, ‘$searchTerm’)
accountList;
B. @AuraEnable(getAccounts, {searchTerm: ‘$searchTerm’})
accountList;
C. @wire(getAccounts, ‘$searchTerm’)
accountList;
D. @wire(getAccounts, {searchTerm: ‘$searchTerm’})
D
99 - A company has been adding data to Salesforce and has not done a good job of limiting the creation of duplicate Lead records. The developer is considering writing an Apex process to identify duplicates and merge the records together.
Which two statements are valid considerations when using merge?
Choose 2 answers
A. The merge method allows up to three records with the same sObject type to be merged into one record.
B. The field values on the master record are overwritten by the records being merged.
C. Merge is supported with accounts, contacts, and leads.
D. External ID fields can be used with the merge method.
A and C
100 - A recursive transaction is initiated by a DML statement 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?
A. The transaction fails only if the Contact trigger stack depth is greater or equal to 16.
B. The transaction fails and all the changes are rolled back.
C. The transaction succeeds as long as the Contact trigger stack depth is less than 16.
D. The transaction succeeds and all changes are committed to the database.
D
101 - A developer is tasked by Universal Containers to build out a system to track the container repair process. Containers should be tracked as they move through the repair process, starting when a customer reports an issue and ending when the container is returned to the customer.
Which solution meets these business requirements while following best practices?
A. Develop a new system with automated notifications to move the containers through the repair process while notifying the customer that reported the issue.
B. Build a customized Lightning Application using Application Events to ensure data integrity.
C. Build a mobile application using Platform Events and RFID integration to ensure proper tracking of the containers and keep the customer informed.
D. Involve a Salesforce administrator and build out a declarative solution that will be easy to maintain and likely cost less than customized development.
A