A Visualforce page loads slowly due to the large amount of data it displays.
Which strategy can a developer use to improve the performance?
AUse Javascript to move data processing to the browser instead of the controller.
BUse the transient keywords for the List variables used in the custom controller.
CUse lazy loading to load the data on demand, instead of the controller's constructor.
DUse an apex:actionPoller in the page to load all of the data asynchronously.
A company's support process dictates that any time a Case is closed with a Status of 'Could not fix', an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case.
What is the correct way to automate this using an Apex trigger?
AAn after update trigger that creates the Engineering Review record and inserts it
BA before update trigger that creates the Engineering Review record and inserts it
CAn after upsert trigger that creates the Engineering Review record and inserts it
DA before upsert trigger that creates the Engineering Review record and inserts it
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<Survey_c> createSurveys = new List<Survey_c>(); 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?
AA user is creating the record as Closed
BA workflow rule is firing with a Create Task action
CA workflow rule is firing with a Field Update action
DA user is editing the record multiple times
What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity = false; List<opportunity> opptysClosedLost = new List<opportunity>() List<opportunity> 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;
ASOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
BThe code will result in a System.LimitException : Too many script statements error
CThe code will result in a System.DmlException:Entity_is_Deleted error
DThe code will result in a System.LimitException: Apex CPU time limit exceeded error
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<Contact> contactsToBeInserted=new List<Contact>(); 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);
ABoth inserts succeed and the contact record that has the Zone value of 'PI'I'I' is set to NULL
BA partial insert succeeds and the contact record that has the Zone value 'IAD' is inserted
CBoth inserts succeed and the contact record that has the Zone value of 'PITT' is truncated
DAn unhandled DML exception is thrown and no contact records are inserted
Which statement is true regarding the use of user input as part of a dynamic SOQL query?
AFree text input should not be allowed, to avoid SOQL injection
BThe String.format() method should be used to prevent injection
CQuotes should be escaped to protect against SOQL injection
DThe string should be URL encoded by the input form to prevent errors
A developer has written the following method:
static void processList(List<sobject> input){
Which code block can be used to call the method?
AprocessList (acc)
BprocessList ([FIND 'Acme" 'RETURNING Account])
CprocessList([SELECT Id, Name FROM sObject WHERE Type = 'Account'])
Dfor Account acc : [SELECT Id, Name FROM Account])
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.)
AConfigure a custom field as unique
BConfigure a custom field as indexed
CConfigure a custom field as external ID
DConfigure a custom field as Salesforce ID
A developer encounters an error that states that the Apex heap size is exceeded.
Which technique may reduce heap size?
AAdd the transient keyword to the variable definition
BMove the variable definition inside the scope of the function
CUse static variables instead of instance variables
DUse SOQL for loops instead of standard SOQL queries
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?
AThe "Execution Log" Panel
BThe "Execution Stack" Panel
CThe "Executed Units" tab under the Execution Overview Panel
DThe "Execution Tree" tab under the Stack Tree Panel
What is a consideration when testing batch Apex? (Choose two.)
ATest methods must execute the batch with a scope size of less than 200 records
BTest methods must call the batch execute() method once
CTest methods must use the @isTest (SeeAllData=true) annotation
DTest methods must run the batch between Test.startTest() and Test.stopTest()
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); } }
A1, 2, 3, 3
B1, 2, 3, 4
C2, 2, 4, 4
D2, 2, 3, 3
A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system
(OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce.
What is the optimal method to implement this?
AGenerate the Enterprise WSDL and use it to make a callout to the OMS.
BGenerate the Partner WSDL and use it to make a callout to the OMS.
CCreate an Outbound Message that contains the session ID and send it to the OMS.
DCreate an Apex trigger and make a callout to the OMS from the trigger.
A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)
AHTTPCalloutMock
BHTTPRequestMock
CHTTPResponseMock
DStaticResourceCalloutMock
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?
AUse the apex:message tag to display errors
BUse the aura:component tag to display errors
CUse the ui:outputText tag to display errors
DUse the ui:inputDefaultError tag to display errors
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?
ASystem.assertEquals(true, isFreezing(null))
BSystem.assertEquals (true, isFreezing('0')
CSystem.assertEquals(null, isFreezing('asdf'))
DSystem.assertEquals(true, isFreezing('IOO'))
During the order of execution of a Visualforce page GET request, what happens after this step?
Evaluate constructors on controllers and extensions
AEvaluate constructors and expressions on custom components
BCreate view state if <apex: form> exists
CSend the HTML response to the browser
DEvaluate expressions, action attributes, and method calls
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?
AUse the Apex Inbound Email Handler
BUse the Fuel API with Email Data Extensions
CUse Heroku Data Clips to Process Email
DUse Auto-launched Flow and Process Builder
How can Apex be used with Visual Workflow?
ATo set the version of a Flow being run
BTo start a Flow automatically
CTo add custom styling to a Flow
DTo control access to a Flow
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?
ANamed Credentials
BSession ID
COAuth access token
DSecurity token
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.)
ASegregate calculation functionality from input functionality
BSpecify the list of sales forecasts as transient
CImplement pagination and reduce records per page
DCreate formula fields to compute pivoted forecast calculations
EUse JavaScript Remoting instead of controller actions
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.)
ASurround the callout with Test.startTest(), Test.stopTest()
BSurround the data insertion with Test.startTest(), Test.stopTest()
CImplement the WebServiceMock interface
DUpdate code to call Test.setMock()
EImplement the HttpCalloutMock interface
Which of the follow be used together in DML operations (transaction)? (Choose two.)
AAccount - AccountShare
BCase - CaseComment
COpportunity - User
DAccount - Order
Consider the Apex controller above, that is called from a Lightning Aura Component.
What is wrong with it?
ALine 1: class must be global
BLines 1 and 6: class and method must be global
CLine 6: method must be static
DLine 8: method must first serialize the list to JSON before returning
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?