Free Certified Platform Developer II Exam Braindumps (page: 6)

Page 6 of 90

A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration is periodically reporting errors.
Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?

  1. Remove the Apex Class from the Integration User's Profile.
  2. Use the Database method with allOrNone set to False.
  3. Use a Try/Catch block after the insert statement.
  4. Deactivate the Trigger before the Integration runs.

Answer(s): B



An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account’s address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact’s state.

Consider the following: A mass update of 200 Account records’ addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.

What will happen when the mass update occurs?

  1. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.
  2. There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.
  3. There will be no error, since the limit on the number of records processed by DML statements is 50,000.
  4. The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.

Answer(s): A



A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?

  1. Add a before insert trigger on Account to set the value of the required field.
  2. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.
  3. Change the required field to be a validation rule that excludes the System Administrator profile.
  4. Add the required field to the data setup for all of the unit tests.

Answer(s): B



A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component.
What should the developer do to ensure a more meaningful message?

  1. Add an onerror event handler to the tag.
  2. Add an error-view component to the markup.
  3. Use an AuraHandledException in a try/catch block.
  4. Use ProcessBuilder to catch the error.

Answer(s): C



Page 6 of 90



Post your Comments and Discuss Salesforce Certified Platform Developer II exam with other Community members:

Jenil Gandhi commented on November 14, 2024
Hi everyone could sone share the certification voucher for PD2.
INDIA
upvote

Aniq commented on December 02, 2023
Hi every one Could some share the certification voucher for PD2
Anonymous
upvote

Rasheed commented on June 07, 2023
Worth the price. I got 50% off when I selected 2 exams.
PAKISTAN
upvote

Lisha commented on September 21, 2022
Thank you!
Anonymous
upvote