Quiz #4

Published in Quizzes

1. Is it true that Trigger.old would remain the same in the second trigger call when a record is updated and subsequently triggers a workflow rule field update?

  1. Yes
  2. No

Reveal answer


The Answer is A.

Trigger.old contains a version of the objects before the specific update that fired the trigger. However, there is an exception. When a record is updated and subsequently triggers a workflow rule field update, Trigger.old in the last update trigger doesn't contain the version of the object immediately before the workflow update, but the object before the initial update was made. For example, suppose that an existing record has a number field with an initial value of 1. A user updates this field to 10, and a workflow rule field update fires and increments it to 11. In the update trigger that fires after the workflow field update, the field value of the object obtained from Trigger.old is the original value of 1, rather than 10, as would typically be the case.

2. How long is the field history retained though your org?

  1. 12 months
  2. 18 months
  3. 24 months
  4. All the time

Reveal answer


The Answer is B.

Field history data is retained for up to 18 months through your org, and up to 24 months via the API.

3. Which exceptions names are correct?

  1. MyException
  2. MyException2
  3. MyError
  4. InvalidFieldError

Reveal answer


The Answer is A.

To create your custom exception class, extend the built-in Exception class and make sure your class name ends with the word Exception, such as "MyException" or "PurchaseException".

Comments powered by CComment