Spring 16 – API 36

Chapter 7

API 36 adds the System.isQueueable call that is true when in a Queueable Apex context. For code using API 36 or later, isBatch is false during queuable contexts. So it’s very important when upgrading code from API 35 to later versions, to audit all use of isBatch to decide if you need to test isQueueable instead or in addition to isBatch.

Chapter 10

Just a note that you should be aware of the Test.setCreatedDate method for setting the createddate on test records. This does not invalidate anything in the book, but does offer greater flexibility in test design patterns for some scenarios.

Custom Metadata.

Generally speaking, custom metadata is preferred over custom settings in scenarios where all of the following conditions apply:

  • Org specific development – while there are specific scenarios where custom metadata makes sense for managed packages, in particular extension packages, the inability to write custom metadata using Apex makes it otherwise a poor choice for managed packages.
  • Replacement for list custom settings. Custom metadata is not a good choice to replace hierarchical custom settings.
  • Scenarios that don’t require a custom configuration UI. Because Apex cannot write custom metadata, custom metadata records can only be edited through the Salesforce UI (or metadata API) by users with sufficient permission to author metadata.

This is not really a “correction” to the book, in that it does not invalidate anything in the book – but it is a feature the book does not address that you should be aware of.