Tuesday, June 21, 2011

Salesforce Empty Key Id - 000000000000000AAA

Working through some data export CSV files I came across the ID "000000000000000AAA". Turns out this is the Empty Key and it can be used for reference relationships where there is no target record (Query for null parent ID).

Foreign keys that are empty typically point to the "Empty Key".
Benji Jasik, Senior Director Product Management

Oddly when that same data is exported via the data loader it appears as the empty string.

Force.com Explorer shows blank values for the following query. Note the use of the EmptyKey in the Where clause.

SELECT AccountId, Subject, WhoId FROM Task where AccountId = '000000000000000AAA'

So the Empty Key ID appears to be used internally to represent an empty reference.

The cross-reference ID field value is either:
* a valid record in your organization, or
* an empty value, which indicates an empty reference
(Reference Field Type)

See Also: