ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











Employee_c is a Child object of Company_c. The Company_c object has an external Id field Company_ld_c.

How can a developer insert an Employee_c record linked to Company_c with a Company_ld_c of '999'?

A.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = f999f insert emp;
A.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = f999f insert emp;
Answers
B.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_c = f999f insert emp;
B.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_c = f999f insert emp;
Answers
C.
Employee_c emp = new Employee_c(Name=fDeveloperT); emp. Company_c = new Company_c(Company_Id_c=f 999 T) insert emp;
C.
Employee_c emp = new Employee_c(Name=fDeveloperT); emp. Company_c = new Company_c(Company_Id_c=f 999 T) insert emp;
Answers
D.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = new Company _ r(Company Id c=f999f) insert emp;
D.
Employee_c emp = new Employee_c(Name=fDeveloperf); emp.Company_r = new Company _ r(Company Id c=f999f) insert emp;
Answers
Suggested answer: D

A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed.

How can the developer meet these requirements?

A.
Use @Cache annotation
A.
Use @Cache annotation
Answers
B.
Use a StandardSetController
B.
Use a StandardSetController
Answers
C.
Use OFFSET in SOQL queries
C.
Use OFFSET in SOQL queries
Answers
D.
Use OFFSET WITH CACHE in SOQL queries
D.
Use OFFSET WITH CACHE in SOQL queries
Answers
Suggested answer: B

Which use case is an appropriate fit for the ©future asynchronous Apex method? (Choose two.)

A.
A developer has jobs that need larger query results than regular transactions allow
A.
A developer has jobs that need larger query results than regular transactions allow
Answers
B.
A developer needs to segregate DML operations and bypass the mixed save DML error
B.
A developer needs to segregate DML operations and bypass the mixed save DML error
Answers
C.
A developer has long-running jobs with large data volumes that need to be performed in batches
C.
A developer has long-running jobs with large data volumes that need to be performed in batches
Answers
D.
A developer has long-running methods and needs to prevent delaying an Apex transaction
D.
A developer has long-running methods and needs to prevent delaying an Apex transaction
Answers
Suggested answer: B, D

A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records.

How should the developer handle the recursive trigger?

A.
Deactivate the trigger and move the logic into a Process or Flow
A.
Deactivate the trigger and move the logic into a Process or Flow
Answers
B.
Deactivate the workflow rule to prevent the field update from executing
B.
Deactivate the workflow rule to prevent the field update from executing
Answers
C.
Use a static variable to prevent the trigger from executing more than once
C.
Use a static variable to prevent the trigger from executing more than once
Answers
D.
Use a global variable to prevent the trigger from executing more than once
D.
Use a global variable to prevent the trigger from executing more than once
Answers
Suggested answer: C

A company wants to create a dynamic survey that navigates users through a different series of questions based on their previous responses.

What is the recommended solution to meet this requirement?

A.
Dynamic Record Choice
A.
Dynamic Record Choice
Answers
B.
Lightning Process Builder
B.
Lightning Process Builder
Answers
C.
Visualforce and Apex
C.
Visualforce and Apex
Answers
D.
Custom Lightning Application
D.
Custom Lightning Application
Answers
Suggested answer: A

Which statement is true regarding both Flow and Lightning Process? (Choose two.)

A.
Can use Apex methods with the @lnvocableMethod annotation
A.
Can use Apex methods with the @lnvocableMethod annotation
Answers
B.
Are both server-side considerations in the Order of Execution
B.
Are both server-side considerations in the Order of Execution
Answers
C.
Can use Apex that implements the Process.Plugin interface
C.
Can use Apex that implements the Process.Plugin interface
Answers
D.
Are able to be embedded directly into Visualforce pages
D.
Are able to be embedded directly into Visualforce pages
Answers
Suggested answer: A, C

A developer has a page with two extensions overriding the Standard controller for Case.

What will happen when a user clicks the command button?

A.
All of the three Save methods will be executed
A.
All of the three Save methods will be executed
Answers
B.
Save from Case Standard Controller will be executed
B.
Save from Case Standard Controller will be executed
Answers
C.
Save from CaseExtensionTwo will be executed
C.
Save from CaseExtensionTwo will be executed
Answers
D.
Save from CaseExtensionOne will be executed
D.
Save from CaseExtensionOne will be executed
Answers
Suggested answer: D

What is a valid request for the following REST method? (Choose two.)

@HttpPost global static void myPostMethod(String si, Integer il, Boolean bl, String 52)

A.
<request> <sl>my first string</sl> <ll>123</il> <32>my second string</32> <bl>false</bl></request>
A.
<request> <sl>my first string</sl> <ll>123</il> <32>my second string</32> <bl>false</bl></request>
Answers
B.
<request> <sl>"my first string"</sl> <il>123</il> <sZ>!,my second string"</32> <bl>false</bl></request>
B.
<request> <sl>"my first string"</sl> <il>123</il> <sZ>!,my second string"</32> <bl>false</bl></request>
Answers
C.
si" : "my first string", 11" : "123", "bl" : "false", "S2" : "my second string"
C.
si" : "my first string", 11" : "123", "bl" : "false", "S2" : "my second string"
Answers
D.
il" : 123, "SI" : "my first string", "S2" : "my second string", "bl" : false
D.
il" : 123, "SI" : "my first string", "S2" : "my second string", "bl" : false
Answers
Suggested answer: B, D

A developer wrote a Visualforce page for Sales Reps to add products to an order. The page takes a URL query parameter, productFamily, which filters the product results. The test method for the filter behavior has an assertion failing due to an incorrect number of results.

Why could the test be failing? (Choose two.)

A.
The test does not call Test.startTest()
A.
The test does not call Test.startTest()
Answers
B.
The test does not create product data
B.
The test does not create product data
Answers
C.
The test is not run by a System Administrator
C.
The test is not run by a System Administrator
Answers
D.
The test does not set the current page reference
D.
The test does not set the current page reference
Answers
Suggested answer: B, D

A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

A.
Use the asyncSend() method of the HTTP class to send the request in async context
A.
Use the asyncSend() method of the HTTP class to send the request in async context
Answers
B.
Ensure all callouts are completed prior to executing DML statements
B.
Ensure all callouts are completed prior to executing DML statements
Answers
C.
Move the web service callout into an ©future method
C.
Move the web service callout into an ©future method
Answers
D.
Use Database.insert (order, true) to immediately commit any database changes
D.
Use Database.insert (order, true) to immediately commit any database changes
Answers
Suggested answer: B, C
Total 408 questions
Go to page: of 41