ExamGecko
Home Home / Salesforce / Certified Platform Developer II

Salesforce Certified Platform Developer II Practice Test - Questions Answers, Page 11

Question list
Search
Search

List of questions

Search

Related questions











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?

A.
Both inserts succeed and the contact record that has the Zone value of 'PI'IT is set to NULL
A.
Both inserts succeed and the contact record that has the Zone value of 'PI'IT is set to NULL
Answers
B.
A partial insert succeeds and the contact record that has the Zone value 'IAD1 is inserted
B.
A partial insert succeeds and the contact record that has the Zone value 'IAD1 is inserted
Answers
C.
Both inserts succeed and the contact record that has the Zone value of PITT is truncated
C.
Both inserts succeed and the contact record that has the Zone value of PITT is truncated
Answers
D.
An unhandled DML exception is thrown and no contact records are inserted
D.
An unhandled DML exception is thrown and no contact records are inserted
Answers
Suggested answer: D

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
A.
Free text input should not be allowed, to avoid SOQL injection
Answers
B.
The String.format() method should be used to prevent injection
B.
The String.format() method should be used to prevent injection
Answers
C.
Quotes should be escaped to protect against SOQL injection
C.
Quotes should be escaped to protect against SOQL injection
Answers
D.
The string should be URL encoded by the input form to prevent errors
D.
The string should be URL encoded by the input form to prevent errors
Answers
Suggested answer: C

A developer has written the following method: static void processList(List<sobject> input){ Which code block can be used to call the method?

A.
processList (ace)
A.
processList (ace)
Answers
B.
processList ([FIND 'Acme" 'RETURNING Account])
B.
processList ([FIND 'Acme" 'RETURNING Account])
Answers
C.
processList([SELECT Id, Name FROM sObject WHERE Type = 'Account'])
C.
processList([SELECT Id, Name FROM sObject WHERE Type = 'Account'])
Answers
D.
for Account ace : [SELECT Id, Name FROM Account])
D.
for Account ace : [SELECT Id, Name FROM Account])
Answers
Suggested answer: C

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
A.
Configure a custom field as unique
Answers
B.
Configure a custom field as indexed
B.
Configure a custom field as indexed
Answers
C.
Configure a custom field as external ID
C.
Configure a custom field as external ID
Answers
D.
Configure a custom field as Salesforce ID
D.
Configure a custom field as Salesforce ID
Answers
Suggested answer: A, C

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
A.
Add the transient keyword to the variable definition
Answers
B.
Move the variable definition inside the scope of the function
B.
Move the variable definition inside the scope of the function
Answers
C.
Use static variables instead of instance variables
C.
Use static variables instead of instance variables
Answers
D.
Use SOQL for loops instead of standard SOQL queries
D.
Use SOQL for loops instead of standard SOQL queries
Answers
Suggested answer: D

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
A.
The "Execution Log" Panel
Answers
B.
The "Execution Stack" Panel
B.
The "Execution Stack" Panel
Answers
C.
The "Executed Units" tab under the Execution Overview Panel
C.
The "Executed Units" tab under the Execution Overview Panel
Answers
D.
The "Execution Tree" tab under the Stack Tree Panel
D.
The "Execution Tree" tab under the Stack Tree Panel
Answers
Suggested answer: C

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
A.
Test methods must execute the batch with a scope size of less than 200 records
Answers
B.
Test methods must call the batch execute() method once
B.
Test methods must call the batch execute() method once
Answers
C.
Test methods must use the @isTest (SeeAIIData=true) annotation
C.
Test methods must use the @isTest (SeeAIIData=true) annotation
Answers
D.
Test methods must run the batch between TeststartTestQ and Test.stopTestQ
D.
Test methods must run the batch between TeststartTestQ and Test.stopTestQ
Answers
Suggested answer: A, D

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 accountlnstance: Trigger.New){ if (Trigger . isBefore){ accountlnstance Exec_Count_c += 1; } System, debug (accountlnstance.Exec_Count_c); } }

A.
1,2,3,3
A.
1,2,3,3
Answers
B.
1,2,3,4
B.
1,2,3,4
Answers
C.
2, 2, 4, 4
C.
2, 2, 4, 4
Answers
D.
2,2,3,3
D.
2,2,3,3
Answers
Suggested answer: C

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
A.
HTTPCalloutMock
Answers
B.
HTTPRequestMock
B.
HTTPRequestMock
Answers
C.
HTTPResponseMock
C.
HTTPResponseMock
Answers
D.
StaticResourceCalloutMock
D.
StaticResourceCalloutMock
Answers
Suggested answer: A, D

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
A.
Use the apex:message tag to display errors
Answers
B.
Use the aura:component tag to display errors
B.
Use the aura:component tag to display errors
Answers
C.
Use the uhoutputText tag to display errors
C.
Use the uhoutputText tag to display errors
Answers
D.
Use the uhinputDefaultError tag to display errors
D.
Use the uhinputDefaultError tag to display errors
Answers
Suggested answer: D
Total 408 questions
Go to page: of 41