Explicit Namespace Resolution for Managed Package SOQL

ISV developers get a fix for one of the oldest dynamic SOQL traps in managed packages.

Where

Apex in managed packages, through Database.QueryOptions.

How

Set the explicitNamespace property on the QueryOptions object you pass with a dynamic query. Field references then resolve to the package namespace explicitly, even if the subscriber org has an identically named custom field.

Why

Field name shadowing in subscriber orgs used to cause silent wrong results or runtime errors that were impossible to reproduce in the packaging org. Explicit resolution removes the ambiguity without asking customers to rename their fields.