The Actual Exam Version included actual exam questions verified by IT Experts. We verified questions and updated frequently each month and also based on members’ feedback to keep updating with the real exam. We are offering money back immediately if questions in our Actual Exam Version do not appear in your exam. Highly recommend you take the Actual Exam Version then go to the exam as soon as possible.
QUESTION NO: 41
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
A. insert (records, false)
B. Database.insert(records, false)
C. Database.insert(records, true)
D. insert records
QUESTION NO: 42
Which two relationship queries use the proper syntax? (Choose two.)
A. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry = ‘Media’
B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = ‘Media’
QUESTION NO: 43
A developer built a Component to be used at the front desk for quests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk. What should be used?
A. Application Event
B. DML Operation
C. Component Event
D. ChangeLog
QUESTION NO: 44
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?
A. List contactList = new List (); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
B. List contactList = new List (); Set accountIds = new Set (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
C. List contactList = new List (); Set accountIds = new Set (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
D. List contactList = new List (); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }
QUESTION NO: 45
An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance. When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created. What is the most extendable way to update the Apex Trigger to accomplish this?
A. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
B. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
C. Use a List Custom Setting to disable the trigger for the user who loads the data.
D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.
QUESTION NO: 46
Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?
A. Use the Database.Delete method if the Contact insertion fails.
B. Use the Database.Insert method with allOrNone set to False.
C. Disable Validation rules on Contacts and set default values with a Trigger.
D. Use setSavePoint() and rollback() with a try/catch block.
QUESTION NO: 47
trigger AssignOwnerByRegion on Account ( before insert, before update )
{ List accountList = new List(); for( Account anAccount : trigger.new ) { Region__c theRegion = [ SELECT Id, Name, Region_Manager__c FROM Region__c WHERE Name = :anAccount.Region_Name__c ]; anAccount.OwnerId = theRegion.Region_Manager__c; accountList.add( anAccount ); } update accountList; }
Consider the above trigger intended to assign the Account to the manager of the Account’s region. Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)
A. Use a Map to cache the results of the Region__c query by Id.
B. Move the Region__c query to outside the loop.
C. Remove the last line updating accountList as it is not needed.
D. Use a Map accountMap instead of List accountList.
QUESTION NO: 48
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 of the examples above have correct System.debug statements? (Choose two.)
A. Example 1
B. Example 2
C. Example 3
D. Example 4
QUESTION NO: 49
Which method should be used to convert a Date to a String in the current user’s locale?
A. Date.format
B. String.format
C. String.valueOf
D. Date.parse
QUESTION NO: 50
A company has a custom object, Order__c, that has a required, unique, external ID field called Order_Number__c.
Which statement should be used to perform the DML necessary to insert new records and update existing records in a List of Order__c records?
A. upsert orders;
B. upsert orders Order_Number__c;
C. merge orders Order_Number__c;
D. merge orders;
QUESTION NO: 51
A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system. What is the optimal way to update the Accounts from the external system?
A. Bulk API
B. SOAP API
C. Apex REST Web Service
D. Composite REST API
QUESTION NO: 52
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller’s account number before proceeding with the rest of their call script. Following best practices, what should a developer use to meet this requirement?
A. Apex Trigger
B. Process Builder
C. Flow Builder
D. Approvals
QUESTION NO: 53
What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?
A. Use the Schema namespace.
B. Use a static resource.
C. Perform a callout to the Metadata API.
D. Perform a SOQL Query.
QUESTION NO: 54
A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it. Which method of integration is optimal?
A. REST API
B. Apex SOAP Web Service
C. Soap API
D. Apex REST Web Service
QUESTION NO: 55
A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Also, Workflows that once sent emails and created tasks no longer do so. Which two statements are true regarding these issues and resolution? (Choose two.)
A. The administrators are deploying their own Change Sets, thus deleting each other’s fields from the objects in production.
B. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.
C. Page Layouts should never be deployed via Change Sets, as this causes Workflows and Fieldlevel Security to be reset and fields to disappear.
D. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production.
QUESTION NO: 56
A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page. Which feature of Apex code is required to facilitate this solution?
A. SOSL queries
B. describeSObjects()
C. Dynamic Schema binding
D. REST API
QUESTION NO: 57
Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b.
These are the fields on Customer_Transaction__b:
Account__c Program__c Points_Earned__c Location__c Transaction_Date__c
The following fields have been identified as Index Fields for the Customer_Transaction__b object:
Account__c, Program__c, and Transaction_Date__c.
Which SOQL query is valid on the Customer_Transaction__b Big Object?
A. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c ='Shoppers' AND Transaction_Date__c=2019-05-31T00:00Z
B. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c LIKE 'Shop%' AND Transaction_Date__c=2019-05-31T00:00Z
C. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c INCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z
D. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c EXCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z
QUESTION NO: 58
Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?
A. Apex Batch job that counts the number of Opportunity records
B. SUM() SOQL aggregate query on the Opportunity object
C. SOQL for loop that counts the number of Opportunities records
D. COUNT() SOQL aggregate query on the Opportunity object
QUESTION NO: 59
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow. What can a developer to do address the issue?
A. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method.
B. Move the prerequisite reference data setup to a @testSetup method in the test class.
C. Move the prerequisite reference data setup to a static method in the test class and call that from each test method.
D. Move the prerequisite reference data setup to the constructor for the test class.
QUESTION NO: 60
A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have been fired. What is the optimal way to accomplish this?
A. Use a MassEmailMessage() with an Apex Trigger.
B. Use a Workflow Email Alert.
C. Use an Email Alert with Process Builder.
D. Use a SingleEmailMessage() with an Apex Trigger.
QUESTION NO: 61
UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won. What is the optimal solution for UC Loans to accomplish this?
A. Process Builder
B. Quick Action
C. Workflow Rule
D. Apex Trigger
QUESTION NO: 62
A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call. Which feature should be used to implement these requirements?
A. @future
B. Queueable
C. Process Builder
D. Workflow
QUESTION NO: 63
A developer gets an error saying ‘Maximum Trigger Depth Exceeded’. What is a possible reason to get this error message?
A. The SOQL governor limits are being hit.
B. A process Builder is running that sends mass emails.
C. There are numerous DML operations in the trigger logic.
D. A trigger is recursively invoked more than 16 times.
QUESTION NO: 64
An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called ‘Is Primary’ to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters. What is the optimal way to implement these requirements?
A. Write an after update trigger on Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.
B. Write a Validation Rule on the Contact for the Is Primary logic and a before update trigger on Contact for the last name logic.
C. Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.
D. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.
QUESTION NO: 65
A developer is trying to access org data from within a test class. Which sObject type requires the test class to have the (seeAllData=true) annotation?
A.Report
B. User
C. Profile
D. RecordType
QUESTION NO: 66
The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored. Which options are valid? (Choose two.)
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled Jobs page in setup
QUESTION NO: 67
Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree should be use to analyze events further starting from the one that take the least amount of time
C. The execution tree can be used with the execution log to filter and get specific information about events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time
QUESTION NO: 68
A developer is writing a complex application involving triggers, workflow rules, Apex classes, and processes. The developer needs to carefully consider the order of execution when developing the application.
- Before Triggers
- After Triggers
- Post commit logic such as sending email
- DML committed to the database
- Workflow rules
- Roll-up summary calculations
In what order do the following operations execute?
A. 1, 2, 5, 6, 4, 3
B. 1, 5, 6, 2, 4, 3
C. 1, 2, 4, 5, 6, 3
D. 1, 6, 5, 2, 4, 3
QUESTION NO: 69
A developer has been asked to create code that will meet the following requirements:
Receives input of: Map<Id, Project_c), List
Performs a potentially long-running callout to an outside web service
Provides a way to confirm that the process executed successfully
Which asynchronous feature should be used?
A. @future (callout=true)
B. Database.AllowCallouts interface
C. Schedulable interface
D. Queueable interface
QUESTION NO: 70
A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses. Which tool should the developer use?
A. Developer Console
B. Force.com Migration Tool
C. Workbench
D. Force.com IDE
QUESTION NO: 71
What is a best practice when unit testing a controller? (Choose two.)
A. Simulate user interaction by leveraging Test.setMock()
B. Verify correct references by using getURL()
C. Access test data by using seeAllData=true
D. Set query parameters by using getParameters().put
QUESTION NO: 72
What Visualforce tag can be used to display custom messages in pages using the Salesforce UI styling for errors, warnings, and other types of messages?
A. <apex:customMessage>
B. <apex:error>
C. <apex:message>
D. <apex:pageMessage>
QUESTION NO: 73
A developer is working on code that requires a call to an external web service from a batch.
How should the developer enable this functionality?
A. Implement a custom System.CalloutException class
B. Include Database.AllowCallout() in the class definition
C. Implement an @future method for the callout, and invoke it from the batch
D. Specify “callout=true” in the batch implementation
QUESTION NO: 74
A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex. How can the developer meet these requirements? (Choose two.)
A. Use a StandardSetController
B. Use CURSOR 50 in SOQL queries
C. Use OFFSET in SOQL queries
D. Use LIMIT 50 in SOQL queries
QUESTION NO: 75
A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?
A. Publicly expose a Visualforce page via Force.com Sites
B. Create a web service on Heroku that uses Heroku Connect
C. Host a Web-to-Lead form on the company website
D. Publicly expose an Apex Web Service via Force.com Sites
QUESTION NO: 76
Which is a valid Apex REST Annotation? (Choose two.)
A. @HttpPatch
B. @HttpDelete
C. @HttpUpsert
D. @HttpAction
QUESTION NO: 77
A customer requires that when the billing address field on an Account gets updated, the address field on all its related contact records should reflect the same update. How can this requirement be met with minimal customizations?
A. Create an After Trigger on Account to update its related contact records on update
B. Create a Workflow Rule on Account to update related child Contact records
C. Create a Lightning Process on Account to update related child Contact records
D. Create a scheduled batch job that updates all contact address fields based on the related account record
QUESTION NO: 78
A company requires an external system to be notified whenever an account is updated.
trigger AccountTrigger on Account (after update){ for (Account updatedAccount:Trigger.new){ AccountTriggerHelper.notinyxternalSystem(updatedAccount.id); } } public class AccountTriggerHelperfuture(callout=true){ public static void notinyxternalSystem(Id accountId){ Account acc = [Select id, name from Account where accountId = :accountId]; http objectHttp h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint('http://example.org/restService'); req.setMethod('POST'); req.setBody(JSON.serialize(acc)); HttpResponse res = h.send(req); } }
What LimitException could the following code trigger?
A. System.LimitException: Too many future calls
B. System.LimitException: Too many callouts
C. System.LimitException: Too many SOQL queries
D. System.CalloutException: Callout from triggers are currently not supported
QUESTION NO: 79
A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action. How can the developer accomplish this?
A. Use to create a JavaScript wrapper for the controller method
B. Use the @RemoteAction annotation on the method definition with JavaScript Remoting
C. Use the $Controller global variable to access the controller method via JavaScript
D. Use to enable JavaScript support for the controller method
QUESTION NO: 80
A company exposes a REST web service and wants to establish two-way SSL between
Salesforce and the REST web service. A certificate signed by an appropriate certificate authority has been provided to the developer. What modification is necessary on the Salesforce side? (Choose two.)
A. Create an entry for the certificate in Certificate and Key Management
B. Update the code to use HttpRequest.setClientCertificateName()
C. Configure two-factor authentication with the provided certificate
D. Update the code to use HttpRequest.setHeader() to set an Authorization header