Salesforce Platform Developer I Certification Practice Questions and Answers

docx

School

Florida Polytechnic University *

*We aren’t endorsed by this school

Course

CYBER SECU

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

57

Uploaded by LieutenantIceMosquito28

Report
Test 1: A custom picklist field, Food_Preference__c, exist 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 most efficient way to ensure a value is selected every time a record is saved? Mark the field as Required on the field definition. 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? The transaction succeeds and all changes are committed to the database. 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? Public abstract class ShippingCalculator{ Public virtual void calculate(){?*implementation*?} } A workflow updates the value of a custom field for an existing Account. How can a developer access the updated custom field value from a trigger? By writing a Before Update trigger and accessing the field value from Trigger.new What should a developer use to fix a Lightning web component bug in a sandbox? VS Code
Cloud Kicks (CK) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises CK 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? Add a Lookup field on the Account object to the Global Address object. Which statement describes the execution order when triggers are associated to the same object and event? Trigger execution order can’t be guaranteed. Which three statements are accurate about debug logs? Debug Log Levels are cumulative, where FINE Log level includes all events logged at the DEBUG, INFO, WARN, and ERROR levels. The amount of information logged in the debug can be controlled by the log levels. To View Debug Logs, “Manage Users” of “View All Data” permissions is needed. Ursa Major Solar (UMS) implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permissions for the currently logged-in user while using the custom search tool? Use the with sharing keyword on the class declaration. What are three considerations when using the @InvocableMethod annotation in Apex? A method using the @InvocableMethod annotation can be declared as Public or Global. Only one method using the @InvocableMethod annotation can be defined per Apex class.
A method using the @InvocableMethod annotation must be declared as static. What is the result of the following code? Account a = new Account(); Database.insert(a , false); The record will not be created and no error will be reported. 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? Implement the line amount as a numeric formula field and the order amount as a roll-up summary field. What should a developer do to check the code coverage of a class after running all tests? View the Overall Code Coverage panel of the Tests tab in the Developer Console. A developer wants to import 500 Opportunity records into a sandbox. Because of what reason developer choose Data Loader over the Data Import Wizard? Data Import Wizard does not support Opportunities. Which two statements are accurate regarding Apex classes and interfaces? Classes are final by default. A TOP-LEVEL Class can only have one inner class level. Since Aura application events follow the traditional publish-subscribe model. Which method is used to fire an event?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Fire() 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? @wire(getAccounts, {searchTerm:’$searchTerm’}) accountList; A developer wants to retrieve the Contacts and Users with the email address 'dev@uc.com'. Which SOSL statement should the developer use? FIND {dev@uc.com} IN Email Fields RETURNING Contact(Email), User(Email) 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? The Apex governor limits are reset for each iteration of the execute() method. The Apex governor limits might be higher due to the asynchronous nature of the transaction. A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: Public with sharing class customCtrlr{ Private Account theAccount; Public String actType; Public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id = :ApexPages.currentpage{}.getParameters{}.get('id')];
actType = theAccount.Type; } } Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly referenced on the Visualforce page, What should the developer do to correct the problem? Add a getter method for the actType attribute. A developer wants to invoke an outbound message when a record meets a specific criteria. Which two features satisfy this use case? The Approval Process has the capability to check the record criteria and send an outbound message without an Apex code. Flow Builder can be used to check the record criteria and send an outbound message without additional code. 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? The parent component can invoke a method in the child component. The parent component can use a public property to pass the data to the child component. A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in a custom class, ContactInfo. Which is the correct definition of the Apex method that gets the additional information? @InvocableMethod(label=‘Additional Info’) Public static List<ContactInfo>getInfo(List<Id>contactIds)
{/*Implementation*/} Ursa Major Solar (UMS) has an order system that uses an Order Number to identify an order for customers and service agents. Order records will be imported into Salesforce. How should the Order Number field be defined in Salesforce? Number with External ID Which process automation should be used to send an outbound message without using Apex code? Workflow Rule. What is the maximum number of SOQL queries used by the following code? List<Account> aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList) { List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id]; } 6 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 modify any time in the code. How should the developer declare the DELIVERY_MULTIPLIER constant to meet the business objectives? Static final decimal DELIVERY_MULTIPIER=4.15;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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 a certain default value based on the record type before inserting the record. How can the developer find the current user’s default record type? Use Opportunity.SObjectType.getDescribe().getRecordTypeInfos() to get a list of record types, and iterate through them until isDefaultRecordTypeMapping() is True. Which two operations can be performed using a formula field? Displaying an image based on the opportunity Amount. Calculating a score on a lead based on the information from another field. 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? VSCode. SFDX CLI. Which scenario is valid for execution by unit tests? Set the created date of a record using a system method. How should a developer write unit tests for a private method in an Apex class? Use the Test Visible annotation. Assuming that 'name' is a String obtained by an <apex:inputText> tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection? String query=’%’+name+’%’; List<Account> results=[SELECT Id FROM Account WHERE Name LIKE:query]; String query=’ SELECT Id FROM Account WHERE Name LIKE \”%’+String.escapeSingleQuotes(name)+’%\”; List<Account> results=Database.auery(query);
Consider the following code snippet: public static void insertAccounts (List<Account> theseAccounts) { for (Account thisAccount : theseAccounts) { if (thisAccount.website == null) { thisAccount.website = ‘https://www.demo.com’ ; } } update theseAccounts ; } When the code executes, a DML exception is thrown. How should the developer modify the code to ensure exceptions are handled gracefully? Implement a try/catch block for the DML. A developer needs to prevent the creation of Request__c records when certain conditions exist in the system. A RequestLogic Class exists that checks the conditions. What is the correct implementation? Trigger RequestTrigger on Request__c(before inster){ RequestLogic.validateRecords(trigger.new);} When importing and exporting data into Salesforce, which two statements are true? Developer and Developer Pro sandboxes have different storage limits. Bulk API can be used to import large data volumes in development environments without bypassing the storage limits. Given the following trigger Implementation: trigger leadTrigger on Lead (before update) { final ID BUSINESS_RECORDTYPEID = '012500000009Qad';
for(Lead thisLead : Trigger.new}{ if(thisLead.Company !=null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID; } } } The developer receives deployment errors every time a deployment is attempted from Sandbox to Production. What should the developer do to ensure a successful deployment? Ensure BUSINESS_RECORDTYPEID is retrieved using Schema.Describe calls. A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross-site scripting vulnerability? ApexPages.currentPage().getParameters().get(‘url_param’).escapeHtml4() What should be used to create scratch orgs? Salesforce CLI. Which two statements accurately represent the MVC framework implementation in Salesforce? Validation rules enforce business rules and represent the Controller © part of the MVC framework. Records created or updated by triggers represent the Model (M) part of the MVC framework. What is an example of a polymorphic lookup field in Salesforce? The WhatId field on the standard Event object.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
A developer has to identify 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? Use the Database.Savepoint method to enforce database integrity. Use the System.Limit class to monitor the current CPU governor limit consumption. 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? 2 Cloud Kicks stores Orders and Line Items in Salesforce. For security reasons, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line items on the Order. Which type of relationship should be used? Lookup. A developer needs to join data received from an 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? Create and populate a custom field on the parent object marked as an External ID.
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? Throw new ParityException(‘parity does not match’); Throw new ParityException(); 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? Flow Builder Process Builder What are two use cases for executing Anonymous Apex code? To run a batch Apex class to update all Contacts. To schedule an Apex class to run periodically. What is the result of the following code snippet? public void doWork(Account acct){ for (Integer i = 0; i <= 200; i++) { insert acct; } } 201 Accounts are inserted. 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. Which Apex technique should the developer use? A for loop, with an if/else statement inside.
A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length of the Apex transaction; while being able to share the variable’s state between trigger executions. How should the developer declare maxAttempts to meet these requirements? Declare maxAttempts as a constant using the static and final keywords. A developer is asked to create a Visualforce page that displays some Account fields as well as fields configured on the page layout for related contacts. How should the developer implement this request? Use the <apex:relatedList>tag. 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. ChangeSet 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? Create a test class and methods to cover the Apex trigger. An Approval Process is defined in the Expense_Item__c object. A business rule dictates that whenever a user changes the Status to 'Submitted' on an Expense_Report__c, all the Expense_Item__c records related to the expense report must enter the approval process individually. Which approach should be used to ensure the business requirement is met? Create two Process Builders, one on Expense_Report__c to mark the related Expense_Item__c as submittable and the 2 nd on Expense_Item__c to submit the record for approval. How does the lightning component framework help developers implement solutions faster? By providing device-awareness for mobile and desktops.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
A developer creates a Lightning web component that imports a method within an Apex class. When a Validation button is pressed, that runs to execute complex validations. In this implementation scenario, which artifact is part of the Controller according to the MVC architecture? Apex class. A 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 orgs should they use for their development? Scratch orgs. What are the three characteristics of changeset deployments? Sending a changeset between two orgs require a deployment connection. Changesets can only be used between related organizations. Deployment is done in a one-way, sing transaction. A developer is writing tests for a class and needs to insert records to validate functionality. Which annotation method should be used to create records for every method in the test class? @testSetup A developer must create an Apex class, ContactController, that a Lightning component can use to search for Contact records. Users of the Lightning component should only be able to search for Contact records to which they have access. Which two will restrict the records correctly? Public inherited sharing class ContactController. Public with sharing class ContactController.
What is the value of the Trigger.old context variable in a Before insert trigger? Null. Which two statements are true about Getter and Setter methods as they relate to Visual force? There is no guarantee for orders in which Getter or Setter methods are executed. Getter methods can pass a value from a controller to a page. When 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. How can a developer implement this feature? Build a Flow with Flow Builder. The following Apex method is part of the ContactService class that is called from a trigger: Public static void setBusinessUnitToEMEA(Contact thisContact){ thisContact.Business_Unit__c = ‘EMEA’; update thisContact; } How should the developer modify the code to ensure best practices are met? Public static void setBusinessUnitToEMEA(List<Contact> contacts){ For(Contact thisContact: contacts){thisContact.Business_Unit__c = ‘EMEA’;} update contacts; } Which three data types can a SOQL query return? List Integer sObject
Test 2: Question 1: 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? Database.insert(records, false) Question 2: 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? Standard List Controller Question 3: A 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? Developer console Question 4: Which code should be used to update an existing Visualforce page that uses a standard Visualforce component so that the page matches the look and feel of Lightning Experience? <apex:page LightningStyleSheets=”true”> Question 5: What should a developer use to script the deployment and unit test execution as part of continuous integration? Salesforce CLI. Question 6: 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? Implement pagination with a StandardSetController.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 7: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use? Public void doWork(sObject theRecord) Question 8: A team of many developers works in their own individual orgs that have the same configuration as the production org. Which type of org is best suited for this scenario? Developer Sandbox. Question 9: 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? Specify lightning_RecordPage as a target in the XML file. Ensure isExposed is set to true on the XML file. Question 10: A developer needs to implement the functionality for a service agent to gather multiple pieces of information from a customer in order to send a replacement credit card. Which automation tool meets these requirements? Flow Builder. Question 11: 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? SELECT Id, (SELECT Id FROM Trainers__r) FROM Gym__c WHERE Name=’Viridian City Gym’
Question 12: The code below deserialized input into a list of Account. 01 public class AcctCreater { 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 getAccountsJson implementation 09 } Which code modification should be made to insert the Accounts so that field- level security is respected? 05 SObjectAccessDecision sd = Security.stripInaccessible(AccessType.CREATABLE, accts); Question 13: Which two characteristics are true for Aura component events? The even propagates to every owner in the containment hierarchy. If a container component needs to handle a component event, add an includeFacets=”true” attribute to its handler. Question 14: 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? An invocable method. Question 15:
Which three operations affect the number of times a trigger can fire? Workflow Rules. Roll-up Summary fields. Lightning Flows. Question 16: A developer wants to get access to the standard pricebook in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the pricebook? Use Test.getStandardPricebookId() to get the standard pricebook ID. Question 17: What is the fundamental difference between a Master-Detail relationship and a Lookup relationship? A Master-Detail relationship detail record inherits the sharing and security of its master record. Question 18: What are two characteristics related to formulas? Formulas are calculated at runtime and are not stored in the database. Formulas can reference values in related objects. Question 19: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat: List<Contact> performSearch(String lastName){ return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%' ); } What are two ways the developer can update the method to prevent a SOQL Injection attack? Use a variable binding and replace the dynamic query with the static SOQL. Use the escapeSingleQuotes method to sanitize the parameter before its use.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 20: 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 the 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’, 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? Move the DML that saves opportunities outside of the for loop. Query for existing opportunities outside the for loop.
Question 21: An org has two custom objects: Plan__c , which has a master-detail relationship to the Account object. Plan_Item__c , which 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, Account, and all of the Plan_Item_c records related to those Plan__c records. A standard controller with a controller extension. Question 22: 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? Collect the insert method return value in a SaveResult record. Question 23: Example 1: AggregateResult[] groupedResults = [SELECT CampaignID, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get('expr0')); } Example 2:
AggregateResult[] groupedResults = [SELECT CampaignID, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignID]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get(‘theAverage')); } Example 3: AggregateResult[] groupedResults = [SELECT CampaignID, AVG(Amount) FROM Opportunity GROUP BY CampaignID]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get.AVG ()); } Example 4: AggregateResult[] groupedResults = [SELECT CampaignID, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignID]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.theAverage); } Which two examples above use the system.debug statements to correctly display the results from the SOQL aggregate queries? Example 1 & 2. Question 24: 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? Lightning Data Service handles sharing rules and field-level security. Question 25: Which two are phases in the Salesforce Aura Application Event propagation framework?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Default. Bubble. Question 26: 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? Create the picklist on each object and use a Global Picklist Value Set containing the values. Question 27: How many Accounts will be inserted by the following block of code? for (Interger i = 0 ; i < 500; i++) { Account a = new Account {Name='New Account ' + i); insert a; } 0
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 28: A developer is building custom search functionality that uses SOSL to search account and contact records that match search term 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<sObject>> searchTerms (List<String> termList) { List<List<sObject>> result = new List<List<sObject>> ( ); 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 the search without a governor limit? 20 Question 29: Which two events need to happen when deploying to a production org? All triggers must have at least 1% test coverage. All Apex code must have at least 75% test coverage. Question 30: How can a developer check the test coverage of auto-launched Flows before deploying them in a change set? Use SOQL and the Tooling API.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 31: Given the code below: List<Account> alist = [SELECT Id FROM Account]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); } What should a developer do to correct the code so that there is no chance of hitting a governor limit? Combine the two SELECT statements into a single SOQL statement Question 32: A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of tests allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test? Use @testSetup with a void method. Question 33: 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? An unhandled exception is thrown and the code terminates. Question 34: A developer wrote Apex code that calls out to an external system. How should a developer write the test to provide test coverage? Write a class that implements the HTTPCalloutMock interface.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 35: Where are two locations a developer can look to find information about the status of batch or future methods? Apex Flex Queue. Apex Jobs. Question 36: A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration that reads task records is periodically reporting errors. Which change should the developer make to ensure the integration is not affected with minimal impact to business logic? Use the database method with allOrNone set to False. Question 37: 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 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 error? Use Security.stripInaccessible to remove fields inaccessible to the current user. Question 38: 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? Global Inherited sharing class ProcessAccountProcessor implements Database.Batchable<sObject>, Schedulable. Question 39: For which three items can a trace flag be configured? Apex Class. Apex Trigger. User.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 40: A developer wrote the following two classes: public with sharing class StatusFetcher { private Boolean active = true; private Boolean isActive ( ) { return active; } } public with sharing class Calculator { public void docalculations ( ) { StatusFetcher sFetcher = new StatusFetcher ( ); If (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? Make the isActive method in the StatusFetcher class public. Question 41: Which Salesforce org has a complete duplicate copy of the production org including data and configuration?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Full Sandbox. Question 42: The following automations already exists on the Account object: A workflow rule that updates a field when a certain criteria is met A custom validation on the 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? The trigger may fire multiple times during a transaction. Question 43: 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 System.CalloutException is occurring. What should the developer do to fix this error? Move the callout to an asynchronous method with @future(callout=true) annotation.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 44: 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? Using a formula field reduces maintenance overhead. A formula field will calculate the value retroactively for existing records. Question 45: 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 Procuct_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 qty) { Integer newInventoryAmt = getNewInventoryAmt (prodId, qty); Product_c p = new Product_c (Id = prodId, Inventory_c = newInventoryAmt); update p; // code goes here }
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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? InventoryReductionEvent_e ev = new InventoryReductionEvent_e(ProductId_c=prodId, Reduction_c=qty); EventBus.publish(ev) Question 46: Which annotation exposes an Apex class as a RESTful web service? @RestResource Question 47: Refer to the code below: const p1 = 3.1415926; What is the data type of p1? Number Question 48: A developer must provide custom user interfaces when users edit a Contact in either Salesforce Classic or Lightning Experience. What should the developer use to override the Contact's Edit button and provide this functionality? A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. Question 49: 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? Order_Shipment_Group_c object and master-detail field on Order_Line_c.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 50: Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage. How should a developer accomplish this? Use a validation rule. Question 51: 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’ ); Insert myAccount; Integer x = 1; List<Account> newAccounts = new List<Account> ( ); do ( Account acct = new Account (Name = ‘New Account ’ + x++ ); newAccounts.add(acct); ) while (x < 10); How many total accounts will be in the org after this code is executed? 5. Question 52: Which three steps allow a custom SVG (Scalable Vector Graphic) to be included in a Lightning web component? Upload the SVG as a static resource. Import the static resource and provide a getter for it in JavaScript. Reference the getter in the HTML template. Question 53:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
What does the Lightning Component framework provide to developers? Prebuilt components that can be resused. Question 54: A developer is tasked with performing a complex validation using Apex as part of advanced business logic. When certain class 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? Public class PurchaseOrderException extends Exception{} Question 55: The initial value for a number field on a record is 1. A user updated the value of the number field to 10. This action invokes a workflow field update, which changes the value of the number field to 11. After the workflow field update, an update trigger fires. What is the value of the number field of the object that is obtained from Trigger.old? 1. Question 56: Which code in a Visualforce page and/or controller might present a security vulnerability? <apex:outputText escape=”false” value=”{! $CurrentPage.parameters.usersInput}” /> Question 57: Which action may cause triggers to fire? Updates to Feed Items. Question 58: Which three code lines are required to create a Lightning component on a Visualforce page? <apex:includeLightning/> $Lightning.use $Lightning.createComponent Question 59: While writing an Apex class that creates Accounts, a developer wants to make sure that all required fields are handled properly. Which approach should the developer use to sure that the Apex class works correctly? Run the code in an Execute Anonymous block.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 60: A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided 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? Create a static resource containing test data. Use Test.loadData to populate data in your test methods. Question 61: 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? Validation Rule. Question 62: 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? Add static to the server-side method signature. Question 63: 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_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 the user? Share the parent Case and Defect_c records. Question 64: The salesforce Administrator created a custom picklist field, Account_Status__c, on the Account object. This picklist has possible values of “Inactive” and “Active”.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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 two automation tools should be used to fulfill the business need? Process Builder. Salesforce Flow. Question 65: A developer identifies the following triggers on the Expense__c object: deleteExpense , 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? Create helper classes to execute the appropriate logic when a record is saved. Unify all three triggers in a single trigger on the Expense__c object that includes all events.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Test 3: Question 1: 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? Limits Question 2: Which aspect of Apex programming is limited due to multitenancy? The number of records returned from database queries. Question 3: A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available for the test? Use Test.loadData() and reference a static resource. Question 4: 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? Flow Builder. Question 5: Cloud Kicks (CK) 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?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page. Question 6: Which two settings must be defined in order to update a record of a junction object? Read/Write access on the primary relationship. Read/Write access on the secondary relationship. Question 7: A developer considers the following snippet of code: Boolean isOK; integer x; String theString = 'Hello'; if ( isOK == false && theString == 'Hello' ){ x = 1; } else if (isOK == true && theString == 'Hello') { x = 2; } else if (isOK != null && theString == 'Hello') { x = 3; } else { x= 4; } Based on this code, what is the value of x? 4 Question 8: In the Lightning UI, where should a developer look to find information about a Paused Flow Interview? On the paused Flow Interviews component on the Home page. Question 9: Which three resources in an Aura Component can contain JavaScript functions? Controller Renderer Helper Question 10: Refer to the following code snippet for an environment has more than 200 Accounts belonging to the 'Technology' industry:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
for ( Account thisAccount : [ Select Id, Industry FROM Account LIMIT 250] ) { if (thisAccount.Industry == 'Technology') { thisAccount.Is_Tech__c = true; } update thisAccount; } When the code executes, what happens as a result of the Apex transaction? If executed in a synchronous context, the apex transaction is likely to fail by exceeding the DML governor limit. Question 11: In the following example, which sharing context will myMethod execute when it is invoked? public Class myClass { public void myMethod ( ) { /* implementation */ } } Sharing rules will be inherited from the calling context. Question 12: 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? Declare the class and method using the global access modifier. Question 13: Which exception type cannot be caught? LimitException. Question 14: Given the following code snippet, that is part of a custom controller for a Visualforce page: Public void updateContact(Contact thisContact)( thisContact.Is_Active__c = false; try{ update thisContact; } catch(Exception e){
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
String errorMessage = 'An error occurred 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 have the appropriate level of access? Use if(Schema.sObjectType.Contact.isUpdatable()) Use if(Schema.sObjectType.Contact.fields.Is_Active__c.isUpdatable()) Question 15: Cloud Kicks(CK) 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? Declarative development can be done using the Setup UI. Declarative development does not require Apex test classes. Question 16: Which two are best practices when it comes to Aura component and application event handling? Reuse the event logic in a component bundle, by putting the logic in the helper. Handle low-level events in the event handler and re-fire them as higher-level events Question 17: Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'? List<List<sObject>> searchList=[FIND “*ACME*” IN ALL FIELDS RETURNING Contact, Lead]; Question 18: A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount for a Contact, based on a number of factors. What is the correct definition of the Apex Method? @InvocableMetohod Global static List<List<Recommendation>>getLevel(List<ContactWrapper>input) { implementation}
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 19: What are the 3 ways for a developer to execute tests in an org? Salesforce DX Tooling API Setup Menu Question 20: A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class. public virtual class Payment { public virtual void makePayment (Decimal amount) ( /*implementation*/ ) } Which is the correct implementation? Public class CreditCardPayment extends Payment{ Public override void makePayment(Decimal amount) {implementation}} Question 21: The Job_Application__c custom object has a field that is a Master-Detail relationship to the contact object, where the contact object is the Master. As part of feature implementation, a developer needs to retrieve a list containing all contact records where the related Account Industry is ‘Technology’ while also retrieving the contact’s Job_application__c records. Based on the object's relationships, what is the most efficient statement to retrieve the list of contacts? [SELEC Id,(SELECT Id FROM Job_Application__r)FROM Contact WHERE Account.Industry=’Technology’]; Question 22: 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 so the temperature can be converted and displayed. What is the recommended way to accomplish this? The Toggle component should call a method in the Temperatur component. Question 23: A PrimaryId__c custom field exists on the Candidate__c custom object. The field is used to store each candidate’s Id number and is marked as Unique in the schema definition.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each candidate’s primary Id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should a developer implement to streamline the data upload? Update the PrimaryId__c field definition to mark it as an External Id. Question 24: Universal Containers hires a developer to build a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field. Which consideration should a developer be aware of when deciding between SOQL and SOSL? SOQL is able to return more records. SOSL is faster for text searches. Question 25: A 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? Line Item has a Master-Detail field to Order and the Master can be re- parented. Question 26:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
What will be the output in the debug log in the event of a QueryException during a call to the aQuery method in the following example? Querying Accounts. Query Exception. Done. Question 27: What are three capabilities of the <ltng:require> tag when loading JavaScript resources in Aura components? Loading scripts in parallel. One-time loading for duplicate scripts. Specifying loading order. Question 28: What are two ways that a controller and extension can be specified on a Visualforce page? Apex:page controller”Account” extensions=”myControllerExtentsion” Apex:page standardController”Account” extensions=”myControllerExtentsion” Question 29: A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to 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? @InvocableMethod
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 30: Cloud Kicks 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? Master-detail field from Engineering_Support__c to Opportunity. Question 31: A 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 a lightning-record-edit-form, so that 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 ? <lightning-input-field field-name=”Salary__c”></lightning-input-field> Question 32: Universal 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 Order Line Item totals on the Order record? Roll-Up summary field. Question 33: Given the following Anonymous Block: List<Case> casesToUpdate = new List<Case>( ); for (Case thisCase : [SELECT Id, Status FROM Case LIMIT 50000]){ thisCase.Status = 'Working'; casesToUpdate.add(thisCase); } Try { Database.update(casesToUpdate,false); } catch(Exception e){ System.debug(e.getMessage( )); }
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
What should a developer consider for an environment that has over 10,000 Case records? The transaction will falil due to exceeding the governor limit. Question 34: Which three statements are true regarding custom exceptions in Apex? A custom exception class can implement one or many interfaces. A custom exception class must extend the system Exception class. A custom exception class name must end with “Exception”. Question 35: The 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 transaction? Total number of DML statements issued. Question 36: Northern Trail Outfitters (NTO) 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? Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript applications. Question 37: 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? At least one line of code must be executed for the Apex trigger. Apex classes must have at least 75% code coverage org-wide. Question 38: An org has an existing Visualflow that creates an opportunity with an update records element. A developer must update the Visual Flow to also create a Contact and store the created Contact's ID on the Opportunity. Which update should the developer make in the Visual Flow?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Add a new create records element. Question 39: While working in a sandbox an Apex test fails when run in the test Framework, but the Apex test logic succeeds with no exceptions or errors when run in the Developer Console. Why did the method fail in the sandbox test framework but succeed in the Developer Console? The test method relies on existing data in the sandbox. Question 40: 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 a Developer use to ensure only users that should be able to delete Accounts can successfully perform deletions? Schema.sObjectType.Account.isDeletable() Question 41: Which action causes a before trigger to fire by default for Accounts? Importing data using the Data Loader and the Bulk API. Question 42: How should a custom user interface be provided when a user edits an Account in Lightning Experience? Override the Account’s edit button with a Lightning component. Question 43: A developer created a Lightning web component called statusComponent to be inserted into Account record page. Which two things should the developer do to make this component available? Add <target>lightning_RecordPage</target>to the statusComponent.js-met.xml file. Add <isExposed>true</isExposed> to the statusComponent.js- met.xml file. Question 44: A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what is defined for payments in the PaymentProcessor interface. public interface PaymentProcessor {
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class? Public class CheckPaymentProcessor implements PaymentProcessor{ Public void pay(Decimal amount){ code } } Question 45: Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page? <aura:application access=”GLOBAL” extends=”ltng:outApp”> <aura:dependency resource=”c:accountList”/> </aura:application> Question 46: 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; } } 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? Refactor the code above to perform only one SOQL query, filtering by the Set of opportunitIds. Question 47: What are three benefits of using declarative customizations over code? Declarative customizations automatically update with each Salesforce release. Declarative customizations have more flexibility related to limits. Declarative customizations generally require less maintenance. Question 48: An Opportunity needs to have an amount rolled up from a custom object that is not in a Master/Detail relationship. How can this be achieved?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Write a trigger on the child object and use an aggregate function to sum the amount for all related child objects under the Opportunity. Question 49: Northern Trail Outfitters (NTO) wants a list button to display a Visualforce page that allows users to edit multiple records. Which Visualforce feature supports this requirement? recordSetVar page attribute. Question 50: 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 sales Administrator wants to ensure the solution used is bulk safe. Which two automation tools should a developer recommend to meet these business requirements? Process Builder Record-Triggered Flow. Question 51: 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? Select the Allow reparenting option on the master-detail relationship. Question 52: What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface? View the apex Jobs page. Query the AsyncApexJob object. Question 53: 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? Record-Triggered Flow. Question 54: What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers"? FIND ‘UniversalContainers’ IN Name Fields RETURNING lead(id, name), account(id, name), contact(id, name)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 55: Refer to the following code that runs in an execute anonymous block: for(List<Lead> theseLeads : [SELECT LastName, Company, Email FROM Lead LIMIT 2000]){ for(Lead thisLead : theseLeads) { if (thisLead.Email == null) thisLead.Email = assignGenericEmail (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? The transaction will succeed and the full result set changes will be committed to the DB. Question 56: A developer created this Apex trigger that calls Myclass.myStaticMethod: Trigger myTrigger on Contact (before insert) { Myclass.myStaticMethod (trigger.new, trigger.oldMap); } The developer creates a test class with a test method that calls MyClass.mystaticMethod, 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? The deployment fials because the Apex trigger has no code coverage. Question 57: A 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? @AuraEnabled(cacheable=true) Public static List<Opportunity> search(String term){code} Question 58: Universal Containers is building a recruiting app with an Applicant object that stores information about an individual person 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?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Junction object between Applicant and job. Question 59: Instead of sending emails to support personnel directly from Salesforce, UC wants to notify an external system to the event that an unhandled exception occurs. What is the appropriate publish/subscribe logic to meet this requirement? Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD. Question 60: A developer is implementing an Apex class for a financial system. Within the class, the variables ‘creditAmount’ and ‘debitAmount’ 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? Use the final keyword and assign its value when declaring the variable Use the final keyword and assign its value in the class constructor Question 61: When using SalesforceDx, what does a developer need to enable to create and manage scratch orgs? Dev Hub. Question 62: Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required? Event Monitoring Log. Question 63: 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? Use the Test menu on the Developer Console to run all test classes for the Contact trigger Question 64: Ursa Major Solar(UMS) 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?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
The Account records contain Vendor roll-up summary fields. Question 65: Which two sfdc commands can be used to add testing data to a Developer sandbox? Force:data:bulk:upsert Force:data:tree:import Test 4: Question 1: 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. Which method should be used to calculate the estimated ship date for an Order? Use a MAX Roll-Up Summary field on the latest availability date fields. Question 2:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
A developer migrated functionality from JavaScript Remoting to a Lightning web component and wants to use the existing getOpportunities() method to provide data. Which modification to the method is necessary? The method must be decorated with @AuraEnabled Question 3: Which three Salesforce resources can be accessed from a Lightning web component? SVG resources. Static resources. Content asset files. Question 4: What can be developed using the Lightning Component framework? Single-page web apps. Question 5: 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? Action. StandardController. Extentisions. Question 6: What can be used to override the Account’s standard Edit button for Lightning Experience? Lightning component. Question 7: A developer created a new after insert trigger on the Lead object that creates Task records for each Lead. After deploying to production, an existing outside integration that inserts Lead records in batches to Salesforce is occasionally reporting total batch failures being caused by the Task insert statement. This causes the integration process in the outside system to stop, requiring a manual restart. Which change should the developer make to allow the integration to continue when some records in a batch cause failures due to the Task insert statement, so that manual restarts are not needed? Use the Database method with allOrNone set to false.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 8: What are two best practices when it comes to Lightning Web Component Events? Use CustomEvent to pass data from a child to a parent component. Use events configured with bubbles:false and composed:false. Question 9: A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message? <apex:pageMessages /> Question 10: The account object is an organization has a master-detail relationship to a child object called Branch. The following automations exist: Rollup summary fields 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? The trigger may fire multiple times during a transaction. Rollup summary fields can cause the parent record to go through Save. Question 11: What is the benefit of developing applications in a multi-tenant environment? Enforced best practices for development. Question 12: Which two process automation can be used on their own to send Salesforce Outbound Message? Workflow Rule. Flow Builder. Question 13: Given the code below in an Apex class: List<Account> aList = [SELECT Id, Active__c FROM Account]; for (Account a ; aList) {
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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? Add a WHERE clause to the SOQL statement. Question 14: 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 component must be alerted so it can navigate to the next page. How should this be accomplished? Create a custom event. Question 15: A lead developer creates 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? Public class SilverLaptop implements Laptop. Question 16: 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? Global class WebServiceClass{ Private Boolean helperMethod(){/*implementation…*/} Webservice static String updateRecords(){/*implementation…*/} }
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 17: Universal Containers decided 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? Relationships. Custom objects and fields. Roll-up summaries. Question 18: 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? Rich component ecosystem. Self-contained and reusable units of an application. Question 19: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL. What three statements are useful inside the unit test to effectively test the custom controller? String nextPage= controller.save().getUrl(); Test.setCurrentPage(pageRef); ApexPages.currentPage().getParameters().put(‘input’,’TestValue’); Question 20: 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 ? Merge is supported with accounts, contacts, cases, and leads. The merge method allows up to three records, including the master and two additional records with the same sObject type, to be merged into the master record. Question 21:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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 Procuct_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 qty) { Integer newInventoryAmt = getNewInventoryAmt (prodId, qty); Product_c p = new Product_c (Id = prodId, Inventory_c = newInventoryAmt); update 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? InventoryReductionEvent_e ev = new InventoryReductionEvent_e(ProductId_c=prodId, Reduction_c=qty); EventBus.publish(ev) Question 22: A business has a proprietary Order Management System (OMS) that creates orders from their website and fulfills the orders. When the order is created in the OMS, an integration also creates an order record in Salesforce and relates it to the contact as identified by the email on the order. As the order goes through different stages in the OMS, the integration also updates it in Salesforce. It is noticed that each update from the OMS creates a new order record in Salesforce. Which two actions will prevent the duplicate order records from being created in Salesforce? Use the order number from the OMS as an external ID. Ensure that the order number in the OMS is unique.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 23: Which code displays the contents of a Visualforce page as a PDF? <apex:page renderAs=”pdf”> Question 24: Managers at Cloud Kicks(cK) want to ensure that only decommissioned containers are able to be deleted in the system. To meet the business requirement a Salesforce developer adds “Decommissioned” as a picklist value for a 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? Apex trigger. Question 25: Which two statements are true about using the @testSetup annotation in an Apex test class? In a test setup method, test data is inserted once and made available for all test methods in the test class. The @testSetup annotation is not supported when the @isTest(SeeAllData=True) annotation is used. Question 26: 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? Lightning:flow Question 27: Get Cloudy Consulting (GCC) has a multitude of servers that host its customers’ websites. GCC wants to provide a server's 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? Import{subscribe, unsubscribe, onError} from ‘lightning/empApi’; Question 28: A developer needs to create a custom interface in Apex.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Which three considerations must the developer keep in mind while developing the Apex Interface? A method defined in an Apex Interface cannot have an access modifier. A method implementation cannot be defined within the Apex Interface. The Apex class must be declared using the Interface keyword. Question 29: Cloud Klick(CK) wants to back up all of the data and attachments in the Salesforce org once a month. Which approach should a developer use to meet this requirement? Define a Data Export scheduled job. Question 30: A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank. Which automation allows the developer to satisfy this requirement in the most efficient manner? An error condition formula on a validation rule on Opportunity. Question 31: 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? 2. Question 32: Universal Containers uses a simple Order Management app. On the Order Lines, the order line total is calculated by multiplying the Item price with the quantity ordered. There is a Master-Detail relationship between the Order and the Order Lines object. What is the best practice to get the sum of all order line totals on the order header? Roll-up summary field. Question 33:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
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? The method must use the @InvocableMethod annotation. The method must be defined as public. The method must be defined as static. Question 34: 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 SOAP messages over HTTPS. If the connection fails, messages should be retired for up to 24 hours. What is the recommended approach to sync the orders in Salesforce with the order fulfillment system? Set up a Workflow Rule outbound message to the order fulfillment system. Question 35: Universal Containers has created a unique process for tracking container repairs. A custom field, Status__c , has been created within the Container__c custom object. A developer is tasked with sending notifications to multiple external systems every time the value of the Status__c picklist changes. Which two tools should the developer use to meet the business requirement and ensure low maintenance of the solution? Apex trigger. Apex callouts. Question 36: Universal 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, 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 or if the Job’s Preferred_Location__c field is updated.What is the recommended tool a developer should use to meet the business requirement?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Apex trigger.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help