QUESTION NO: 81
What is a consideration when using bind variables with dynamic SOQL? (Choose two.)
A. Dynamic SOQL cannot reference fields on bind variables
B. Dynamic SOQL cannot use bind variables
C. Bind variables must be public or global
D. Bind variables must be in local scope
QUESTION NO: 82
A developer created a custom component to display an HTML table. The developer wants to be able to use the component on different Visualforce Pages and specify different header text for the table. Which tag should the developer use inside the component?
A. <apex:variable>
B. <apex:define>
C. <apex:param>
D. <apex:attribute>
QUESTION NO: 83
Which two objects can be inserted in the same transaction? (Choose two.)
A. Opportunity and User
B. Account and AccountShare
C. Case and CaseComment
D. Account and Group
QUESTION NO: 84
How can the DISTANCE and GEOLOCATION functions be used in SOQL queries? (Choose two.)
A. To filter results based on distance from a latitude and longitude
B. To get the distance results from a latitude and longitude
C. To order results by distance from a latitude or longitude
D. To group results in distance ranges from a latitude and longitude
QUESTION NO: 85
A developer has created a solution using the SOAP API for authenticating Communities users. What is needed when issuing the login() Call? (Choose two.)
A. Organization Id
B. Session Id
C. Username and Password
D. Security Token
QUESTION NO: 86
When developing a Visualforce page that will be used by a global organization that does business in many languages and many currencies, which feature should be used? (Choose three.)
A. Custom Labels
B. convertCurrency()
C. Global Labels
D. Translation Workbench
E. getLocalCurrency()
QUESTION NO: 87
A developer needs test data for Apex test classes.What can the developer use to provide test data to the test methods? (Choose two.)
A. List Is = Test.loadData (Lead.sObjectType, ‘myTestLeads’);
B. myDataFactory.createTestRecords (10)
C. Database.createTestRecords (10)
D. List Is = Test.loadDat (Lead.sObjectType, $Resource + ‘myTestLeads’);
QUESTION NO: 88
[FIND ‘map’ IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead]
What is a valid return type for the following SOSL query?
A. List
B. List<List>
C. List
D. List
QUESTION NO: 89
What level can a hierarchy custom setting be defined for? (Choose three.)
A. Users
B. Groups
C. Profiles
D. Roles
E. Organization
QUESTION NO: 90
A developer has created a Visualforce page that uses a third-party JavaScript framework. The developer has decided to supply data to the JavaScript functions using JavaScript Remoting for
Apex Controllers. What is the correct syntax to declare a remote method in Apex? (Choose two.)
A. @RemoteAction global static String getTable()
B. @RemoteAction global String getTable()
C. @RemoteAction public static String getTable()
D. @RemoteObject global static String getTable()
QUESTION NO: 91
Which API can be used to execute unit tests? (Choose three.)
A. Streaming API
B. Test API
C. Tooling API
D. SOAP API
E. Metadata API
QUESTION NO: 92
Which statement is true about using ConnectApi namespace (also called Chatter in Apex)?
(Choose two.)
A. Chatter in Apex methods honor the ‘with sharing’ and ‘without sharing’ keywords
B. Chatter in Apex operations are synchronous, and they occur immediately
C. Chatter in Apex methods do not run in system mode; they run in the context of the current user
D. Many test methods related to Chatter in Apex require the IsTest (SeeAllData=true) annotation
QUESTION NO: 93
A developer receives a LimitException: Too many query rows: 50001 error when running code.
What debugging approach using the Developer Console provides the fastest and most accurate mechanism to identify a specific component that may be returning an unexpected number of rows?
A. Count the number of Row Limit warning messages in the Debug Logs
B. Add System.debug(System.getQueryRows()) to the code to track SOQL usage
C. Filter the Debug Log on SOQL_EXECUTE_END statements to track the results of each SOQL Query
D. Use the Execution Overview to see the number of rows returned by each Executed Unit
QUESTION NO: 94
A developer is writing a Visualforce page to display a list of all of the checkbox fields found on a custom object. What is the recommended mechanism the developer should use to accomplish this?
A. Schema Class
B. Apex API
C. Schema Builder
D. Metadata API
QUESTION NO: 95
A developer has created a Team Member sObject that has a Master-Detail relationship to a Project sObject and a Lookup relationship to the User sObject. The developer must ensure that a User listed on a Team Member record has Read-Write access to the parent Project record.
How can the developer accomplish this if the Project sObject has a Private sharing model and thousands of Project records?
A. Create a Controller that uses the Without Sharing keyword
B. Create a Criteria-Based Sharing Rule on the Project sObject
C. Create a Team Member Trigger that inserts Project_Share records
D. Create a Project Sharing Rule that shares to the Team Member Group
QUESTION NO: 96
- Contact con = new Contact( LastName =’Smith’, Department = ‘Admin’)
- insert con;
- Contact insertedContact=[select Name from Contact where id=:con.Id];
- Savepoint sp_admin = Database.setSavepoint();
- con.Department = ‘HR’;
- update con;
- Database.rollback(sp_admin);
- System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?
A. 5
B. 3
C. 4
D. 2
QUESTION NO: 97
What is a recommended practice with regard to the Apex CPU limit? (Choose two.)
A. Optimize SOQL query performance
B. Use Map collections to cache sObjects
C. Avoid nested Apex iterations
D. Reduce view state in Visualforce pages
QUESTION NO: 98
A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user. How can this be accomplished? (Choose two.)
A. Use the (apex: information) tag to display the error message
B. Use the ApexPages.addMessage() method to add the error message
C. Use the tag to display the error message
D. Use the account.addError() method to add the error message
QUESTION NO: 99
A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly. What will improve performance? (Choose three.)
A. Reducing the view state
B. Using actionRegion and rerender
C. Turning off the standard stylesheet
D. Setting the Apex Page attribute cache=true
E. Using selective queries
QUESTION NO: 100
A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case.
trigger CaseTrigger on Case (after insert, after update){ List createSurveys = new List(); for (Case c : trigger.new){ if (c.IsClosed && (trigger.isInsert II trigger.isUpdate && trigger.oldMap.get(c.Id).IsClosed == false)){ createSurveys.add(new Survey_c(Case_c = c.Id)); } } insert createSurveys; }
What could be the cause of this issue?
A. A user is creating the record as Closed
B. A workflow rule is firing with a Create Task action
C. A workflow rule is firing with a Field Update action
D. A user is editing the record multiple times
QUESTION NO: 101
What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity = false; List opptysClosedLost = new List() List IstAllOpp = [select StageName from Opportunity where accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty()) processOpportunity = true; while(processOpportunity){ for(opportunity o : IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o); processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete opptysClosedLost;
A. SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
B. The code will result in a System.LimitException : Too many script statements error
C. The code will result in a System.DmlException:Entity_is_Deleted error
D. The code will result in a System.LimitException: Apex CPU time limit exceeded error
QUESTION NO: 102
The Contact object has a custom field called “Zone.” Its data type is “Text” and field length is 3. What is the outcome after executing the following code snippet in the org?
List contactsToBeInserted=new List(); Contact contactInstance= new Contact(LastName='Smith', Department='Tech', Zone_c='IAD'); contactsToBeInserted.add(contactInstance); contactInstance= new Contact(LastName='Sm1th', Department='Tech', Zone_c='PITT'); contactsToBeInserted.add(contactInstance); Database.insert(contactsToBeInserted,true);
A. Both inserts succeed and the contact record that has the Zone value of ‘PI’I’I’ is set to NULL
B. A partial insert succeeds and the contact record that has the Zone value ‘IAD’ is inserted
C. Both inserts succeed and the contact record that has the Zone value of ‘PITT’ is truncated
D. An unhandled DML exception is thrown and no contact records are inserted
QUESTION NO: 103
Which statement is true regarding the use of user input as part of a dynamic SOQL query?
A. Free text input should not be allowed, to avoid SOQL injection
B. The String.format() method should be used to prevent injection
C. Quotes should be escaped to protect against SOQL injection
D. The string should be URL encoded by the input form to prevent errors
QUESTION NO: 104
A developer has written the following method:
static void processList(List input){
Which code block can be used to call the method?
A. processList (acc)
B. processList ([FIND ‘Acme” ‘RETURNING Account])
C. processList([SELECT Id, Name FROM sObject WHERE Type = ‘Account’])
D. for Account acc : [SELECT Id, Name FROM Account])
QUESTION NO: 105
A developer needs to design a custom object that will be integrated into a back-end system. What should the developer do to ensure good data quality and to ensure that data imports, integrations, and searches perform well? (Choose two.)
A. Configure a custom field as unique
B. Configure a custom field as indexed
C. Configure a custom field as external ID
D. Configure a custom field as Salesforce ID
QUESTION NO: 106
A developer encounters an error that states that the Apex heap size is exceeded. Which technique may reduce heap size?
A. Add the transient keyword to the variable definition
B. Move the variable definition inside the scope of the function
C. Use static variables instead of instance variables
D. Use SOQL for loops instead of standard SOQL queries
QUESTION NO: 107
A developer has a Debug method within a class, which is invoked hundreds of times.
What is the optimal functionality in the Developer Console to count the number of calls made to the method?
A. The “Execution Log” Panel
B. The “Execution Stack” Panel
C. The “Executed Units” tab under the Execution Overview Panel
D. The “Execution Tree” tab under the Stack Tree Panel
QUESTION NO: 108
What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records
B. Test methods must call the batch execute() method once
C. Test methods must use the @isTest (SeeAllData=true) annotation
D. Test methods must run the batch between Test.startTest() and Test.stopTest()
QUESTION NO: 109
A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of “1” for a: Exec_Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account:
trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update){ for (Account accountInstance: Trigger.New){ if (Trigger . isBefore){ accountInstance Exec_Count_c += 1; } System. debug (accountInstance.Exec_Count_c); } }
A. 1, 2, 3, 3
B. 1, 2, 3, 4
C. 2, 2, 4, 4
D. 2, 2, 3, 3
QUESTION NO: 110
A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)
A. HTTPCalloutMock
B. HTTPRequestMock
C. HTTPResponseMock
D. StaticResourceCalloutMock
QUESTION NO: 111
A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order’s shipping address is not numeric. What is a recommended way for the error message be displayed to the end user?
A. Use the apex:message tag to display errors
B. Use the aura:component tag to display errors
C. Use the ui:outputText tag to display errors
D. Use the ui:inputDefaultError tag to display errors
QUESTION NO: 112
A developer is writing unit tests for the following method:
public static Boolean isFreezing(String celsiusTemp){ if(String.isNotBlank(celsiusTemp) && celsiusTemp.isNumeric()){ return Decimal.valueof(celsiusTemp) <= 0; } return null; }
Which assertion would be used in a negative test case?
A. System.assertEquals(true, isFreezing(null))
B. System.assertEquals (true, isFreezing(‘0’)
C. System.assertEquals(null, isFreezing(‘asdf’))
D. System.assertEquals(true, isFreezing(‘IOO’))
QUESTION NO: 113
During the order of execution of a Visualforce page GET request, what happens after this step?
Evaluate constructors on controllers and extensions
A. Evaluate constructors and expressions on custom components
B. Create view state if exists
C. Send the HTML response to the browser
D. Evaluate expressions, action attributes, and method calls
QUESTION NO: 114
A developer needs to create a service that will process an email sent to it and create an account and contact using the contents of the email as data for the records. How might a developer accomplish this requirement?
A. Use the Apex Inbound Email Handler
B. Use the Fuel API with Email Data Extensions
C. Use Heroku Data Clips to Process Email
D. Use Auto-launched Flow and Process Builder
QUESTION NO: 115
How can Apex be used with Visual Workflow?
A. To set the version of a Flow being run
B. To start a Flow automatically
C. To add custom styling to a Flow
D. To control access to a Flow
QUESTION NO: 116
An integration user makes a successful login() call via the SOAP API. What can be used in the SOAP header to provide server authorization for subsequent API requests?
A. Named Credentials
B. Session ID
C. OAuth access token
D. Security token
QUESTION NO: 117
A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits.
What are three recommendations to optimize page performance? (Choose three.)
A. Segregate calculation functionality from input functionality
B. Specify the list of sales forecasts as transient
C. Implement pagination and reduce records per page
D. Create formula fields to compute pivoted forecast calculations
E. Use JavaScript Remoting instead of controller actions
QUESTION NO: 118
A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)
A. Surround the callout with Test.startTest(), Test.stopTest()
B. Surround the data insertion with Test.startTest(), Test.stopTest()
C. Implement the WebServiceMock interface
D. Update code to call Test.setMock()
E. Implement the HttpCalloutMock interface
QUESTION NO: 119
Which of the follow be used together in DML operations (transaction)? (Choose two.)
A. Account – AccountShare
B. Case – CaseComment
C. Opportunity – User
D. Account – Order
QUESTION NO: 120
A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication. What code should the developer use to authenticate?
A. Http.setHeader (‘Authorization’ , ‘Basic QthZGprjpchVulHNchFtZQ’)
B. stub.inputHttpHeaders_x.put(‘Authorization’ , ‘Basic QthZGprjpchVulHNchFtZQ’)
C. Http.setAuthentication(‘Basic QthZGprjpchVulHNchFtZQ’)
D. stub.authentication.put (‘Authorization’,’Basic QthZGprjpchVulHNchFtZQ’)