ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











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
A.
Chatter in Apex methods honor the 'with sharing' and 'without sharing' keywords
Answers
B.
Chatter in Apex operations are synchronous, and they occur immediately
B.
Chatter in Apex operations are synchronous, and they occur immediately
Answers
C.
Chatter in Apex methods do not run in system mode; they run in the context of the current user
C.
Chatter in Apex methods do not run in system mode; they run in the context of the current user
Answers
D.
Many test methods related to Chatter in Apex require the IsTest (SeeAIIData=true) annotation
D.
Many test methods related to Chatter in Apex require the IsTest (SeeAIIData=true) annotation
Answers
Suggested answer: C, D

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
A.
Count the number of Row Limit warning messages in the Debug Logs
Answers
B.
Add System.debug(System.getQueryRows()) to the code to track SOQL usage
B.
Add System.debug(System.getQueryRows()) to the code to track SOQL usage
Answers
C.
Filter the Debug Log on SOQL_EXECUTE_END statements to track the results of each SOQL Query
C.
Filter the Debug Log on SOQL_EXECUTE_END statements to track the results of each SOQL Query
Answers
D.
Use the Execution Overview to see the number of rows returned by each Executed Unit
D.
Use the Execution Overview to see the number of rows returned by each Executed Unit
Answers
Suggested answer: C

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
A.
Schema Class
Answers
B.
Apex API
B.
Apex API
Answers
C.
Schema Builder
C.
Schema Builder
Answers
D.
Metadata API
D.
Metadata API
Answers
Suggested answer: A

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
A.
Create a Controller that uses the Without Sharing keyword
Answers
B.
Create a Criteria-Based Sharing Rule on the Project sObject
B.
Create a Criteria-Based Sharing Rule on the Project sObject
Answers
C.
Create a Team Member Trigger that inserts Project_Share records
C.
Create a Team Member Trigger that inserts Project_Share records
Answers
D.
Create a Project Sharing Rule that shares to the Team Member Group
D.
Create a Project Sharing Rule that shares to the Team Member Group
Answers
Suggested answer: C

1 Contact con = new Contact ( LastName =fSmith', Department = fAdminT) 2 insert con; 3 Contact insertedContact=[select Name from Contact where id=icon.Id]; 4 Savepoint sp_admin = Database.setSavepoint(); 5 con.Department = fHRf;

6 update con; 7 Database.rollback(sp_admin); 8 System.debug(Limits.getDmlStatements 0); Given the following code, what value will be output in the logs by line #8?

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

What is a recommended practice with regard to the Apex CPU limit? (Choose two.)

A.
Optimize SOQL query performance
A.
Optimize SOQL query performance
Answers
B.
Use Map collections to cache sObjects
B.
Use Map collections to cache sObjects
Answers
C.
Avoid nested Apex iterations
C.
Avoid nested Apex iterations
Answers
D.
Reduce view state in Visualforce pages
D.
Reduce view state in Visualforce pages
Answers
Suggested answer: B, C

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
A.
Use the (apex: information) tag to display the error message
Answers
B.
Use the ApexPages.addMessage() method to add the error message
B.
Use the ApexPages.addMessage() method to add the error message
Answers
C.
Use the <apex:pageMessages> tag to display the error message
C.
Use the <apex:pageMessages> tag to display the error message
Answers
D.
Use the accountaddErrorQ method to add the error message
D.
Use the accountaddErrorQ method to add the error message
Answers
Suggested answer: B, C

A developer has built a multi-page wizard using a single Custom Controller to query and update dat a. Users are complaining that the pages are loading slowly.

What will improve performance? (Choose three.)

A.
Reducing the view state
A.
Reducing the view state
Answers
B.
Using actionRegion and rerender
B.
Using actionRegion and rerender
Answers
C.
Turning off the standard stylesheet
C.
Turning off the standard stylesheet
Answers
D.
Setting the Apex Page attribute cache=true
D.
Setting the Apex Page attribute cache=true
Answers
E.
Using selective queries
E.
Using selective queries
Answers
Suggested answer: A, D, E

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.

What could be the cause of this issue?

A.
A user is creating the record as Closed
A.
A user is creating the record as Closed
Answers
B.
A workflow rule is firing with a Create Task action
B.
A workflow rule is firing with a Create Task action
Answers
C.
A workflow rule is firing with a Field Update action
C.
A workflow rule is firing with a Field Update action
Answers
D.
A user is editing the record multiple times
D.
A user is editing the record multiple times
Answers
Suggested answer: D

What is a potential design issue with the following code?

A.
SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
A.
SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
Answers
B.
The code will result in a System.LimitException : Too many script statements error
B.
The code will result in a System.LimitException : Too many script statements error
Answers
C.
The code will result in a System.DmException:Entity_is_Deleted error
C.
The code will result in a System.DmException:Entity_is_Deleted error
Answers
D.
The code will result in a System.LimitException: Apex CPU time limit exceeded error
D.
The code will result in a System.LimitException: Apex CPU time limit exceeded error
Answers
Suggested answer: D
Total 408 questions
Go to page: of 41