Developer-2

Following are the sample questions for Platform Developer-2 Dumps. We are having 2 sets each with 60 questions which are Summer'17 updated along with answers
1) What is a recommended practice with regard to the Apex CPU limit? Choose 2 answers
A. Optimize SOQL query performance.
B. Use Map collections to cache sObjects.
C. Avoid nested Apex iterations.
D. Reduce view state in Visualforce pages.

2) 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 2 answers
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.

3) A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses. Which tool should the developer use?
A. Developer Console
B. Force.com Migration Tool
C. Workbench
D. Force.com IDE

4. What is a best practice when unit testing a controller? Choose 2 answers A. Simulate user interaction by leveraging Test.setMock().
B. Verify correct page references by using getURL
C. Access test data by using seeAllData=true.
D. Set query parameters by using getParameters () .put

5) What Visualforce tag can be used to display custom messages in pages using the Salesforce UI styling for errors, warnings, and other types of messages?
A.
B.
c.
D.

6) A Salesforce developer created a Contact validation rule so that the Email field cannot contain "abc.com." There is an active workflow rule that updates the Email field of a contact record to "test@abc.com" if the contact's First Name field contains the word "Test." A customer tries to create a Contact record with the first name "Test Contact" and the email "test@test.com." What behavior will be observed?
A. The customer will receive a system error message.
B. The contact record will be created with the email address "test@abc.com."
C. The customer will receive a validation error message.
D. The contact record will be created with the email address test@test.com.

7) Which two objects can be inserted in the same transaction? Choose 2 answers
A. Account and Group
B. Case and CaseComment
C. Opportunity and User
D. Account and AccountShare

8) What is the tag used for in Visualforce pages?
A. To provide help and support content for buttons and links.
B. To trigger a second action when a button or link is clicked.
C. To trigger controller actions in response to DOM element events.
D. To create a Javascript function that can trigger a controller action.

9) A developer has created an Order entry page that includes an tag for a field label. How can the developer ensure that the label text changes when the field label changes?
A. Use FieldSetMember methods to control label text.
B. Use the SObjectType variable to control label text.
C. Use a custom label to manage the label text.
D. Use the metadata API to update the label text.

10) A developer needs to write tests to ensure that code doesn't fail when it is deployed to a different organization. The developer also must ensure that the code works properly with organization sharing rules and ensure that the code mitigates errors due to limits. How can the developer meet these requirements? Choose 2 answers
A. Create all test data before calling the Test. startTest () and Test .stopTest () methods.
B. Handle all exceptions that are caught by adding an empty catch ( Exception e) statement.
C. Use SeeAllData=true to avoid delaying tests due to creating test data.
D. Use the runAs ( ) method to test the application in different user contexts.