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 list<list> searchTerms(List> termlist (List<List> result = newList<List>();
for (String term : termList) (
result.addAll([FIND :term IN ALL FIELDS RETURNING Account (Name), Contact(FirstName,LastName)]);
)
return result;
)
What is the maximum number of search terms the end-user can provide to successfully execute thesearch without exceeding a governor limit?
2 of 64A 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 its trainers?
3 of 64Which three operations affect the number of times a trigger can fire?
4 of 64A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each line item based on the quantity selected and price.
Move Line Items to a different order if a Line Item is not in stock.
Which relationship implementation supports these requirements?
5 of 64A Lightning component has a wired property, searchResults, that stores a list of Opportunities.
Which definition of the Apex method, to which the searchResults property is wired, should be used?
6 of 64A developer is asked to prevent anyone other than a user with Sales manager profile from changing the opportunity status to Closed if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?
7 of 64Universal Containers uses a master-detail relationship and stores the availability date on each line item of 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?
8 of 64Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?
9 of 64A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a Salary__c custom field.
What should the developer use, along with a lightning-record-edit-form, so that the Salary__c field functions as a currency input and is only viewable and editable by users that have the correct field-level permissions on Salary__c?
10 of 64What can be used to override the account standard edit button for lightning experience?
11 of 64A developer needs to join data received from integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?
12 of 64A 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 org should they use for their development?
13 of 64Universal Hiring is using Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the master object, Job_application__c acting as the detail.
Within the Job_c object, a custom multi-select picklist, Preffered_Locations_c, contain a list of approved state for the position. Each Job_application__c record relates to a contact within the system through a master-detail relationship.
The recruiter has requested the ability to view whether the Contact’s Mailing State value matches a value selected on the Preffered_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 or if the Job’s Preffered_Locations_c field is updated.
What is the recommended tool a developer should use to meet the business requirement?
14 of 64A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit.
public class without sharing Opportunityservice{
public static List getopportunity Products (Set opportunityIds){ List oppLineItems = new List (); for (Id thisoppId: opportunityIds) { oppLineItems.addAll([Select Id FROM OpportunityLineItem WHERE OpportunityId = :thisOppId]); } return oppLineItems;
}
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?
Which two settings must be defined in order to update a record of a junction object?
16 of 64Given the following code snippet that is part of a custom controller for a visual force page:
public void updatecontact(Contact thiscontact) {
thisContact.is_Active__c = false;
try{
update thiscontact;
}catch(Exception e){
String errormessage = ‘An error occured 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 currently logged-in user does not appropriate level of access?
17 of 64A 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.
Which two things should be done to create the test data within the unit test with the least amount of code?
18 of 64What are three ways for a developer to execute tests in an org?
19 of 64Refer 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?
20 of 64Universal Containers has implemented an order management application. Each order can have one or more Order Line items. The order line object is related to the Order via a master-detail relationship. For each order line item, the total price is calculated by multiplying the order line item price with the quantity ordered.
What is the best practice to get the sum of all Order line item totals on the Order record?
21 of 64Which code should be used to update an existing Visualforce page that uses standard Visualforce components so that the page matches the look and feel of Lightning Experience?
22 of 64Which exception type cannot be caught ?
23 of 64What are the two use cases for executing anonymous apex code?
24 of 64A developer wants to invoke an outbound message when a record meets specific criteria.
Which two features satisfy this use case?
25 of 64The following code snippet is executed by a lightning web component in an environment with more than 2000 lead records:
@Auraenabled
public void static updateleads(){
for(Lead thislead : [SELECT ORIGIN__c FROM Lead]){
thislead.leadsource = thislead.origin;
update thislead;
}
}
Which governor limit will likely be exceeded within the Apex transation?
26 of 64A developer receives an error while trying to call a global server-side method using the @remoteAction decorator.
How can the developer resolve the error?
27 of 64When 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 automation tools can be used to implement the feature?
28 of 64A 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_c 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?
29 of 64Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called “Global Address”.
Which field should the developer add to create the most efficient model that supports the business need?
30 of 64Managers at Universal Containers want to ensure that only decommissioned containers are able to deleted in the system. TO meet the business requirement a salesforce developer adds “Decommissioned” as a picklist value for the Status_c custom field within the Container_c object.
Which tool should the developer use to enforce only Container records with a status of “Decommissioned” can be deleted?
31 of 64A 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. Awards points are granted to customers for all completed videos. When the video is marked as complete 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 System.CalloutException is occurring.
What should the developer do to fix this error?
32 of 64A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org.
Which tool should the developer use to troubleshoot?
33 of 64Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account];
What occurs when more than one Account is returned by the SOQL query?
34 of 64Management 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 opplist = [SELECT ID FROM Opportunity WHERE accountId = :a.Id];
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 takes to fix the code segment shown above?
35 of 64A developer identifies the following triggers on the Expense__c object:
deteleExpense,
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?
36 of 64A 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?
37 of 64A 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?
38 of 64A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles.
Which tool should they use to deploy to the sandbox?
39 of 64Refer 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 – true; update thisAccount;
When the code execution, which two events occur as a result of the Apex transaction?
40 of 64Universal 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?
41 of 64Which three statements are accurate about debug logs?
42 of 64A 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?
43 of 64Which three statements are true regarding custom exceptions in Apex?
44 of 64Universal Containers has a 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?
45 of 64A developer is implementing an Apex class for a financial system. Within the class, the variables ‘creditAmount’ and ‘debtAmount’ 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?
46 of 64A 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?
47 of 64A Next Best Action strategy uses an Enchance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors.
What is the correct definition of the Apex method?
48 of 64Which 3 salesforce resources can be accessed from light web component?
49 of 64Cloud 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?
50 of 64Which 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 of some of the related Order Products?
51 of 64A 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?
52 of 64A lead developer needs to create an Apex interface called “Laptop”. Consider the following code snippet:
public class Silverlaptop{
//code implementation
}
How can a developer use the laptop interface within the SilverLaptop class?
53 of 64Which two sfdx commands can be used to add testing data to a developer Sandbox?
54 of 64A 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 user without showing any errors?
55 of 64What are three characteristics of change set deployments?
56 of 64An org has two custom objects:
Plan_c: that has the master-detail relationship to the account object
Plan_Item_c: that has the 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 record related to the account and all of the Plan_Item_c records reated to those Plan_c object?
57 of 64A developer has to identify a method in en 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 SOQL 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?
58 of 64What are two best practice when it comes to lightning web component events?
59 of 64What can be developed using the lightning component framework?
60 of 64The account object in an organization has a master-detail relationship to a child object called Branch. The following automation exist:
Rollup Summary Field
Custom validation Rules
Duplicate rules
A Developer created a trigger on the Account object.
What two things should the developer consider while testing the trigger code?
61 of 64Universal 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?
62 of 64Given the code below in an apex class:
List aList = [SELECT Id, Active_c FROM Account];
for (Account a : aList) {
if (!a.Active_c) {
a.Name = ‘INACTIVE”;
}
}
update alist;
What should a developer do to correct the code so that there is no chance of hitting a governor limit?
63 of 64How can a developer check the test coverage of auto launched flows before deploying them in a change set?
64 of 64A 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 optimal way to ensure a value is selected every time a record is saved?