Please help me understand the SF documentation and the proper use of these fields, in terms of accurately identifying an instance of an EntityDefinition
or FieldDefinition
object.
The use of the word "unique" in the documentation, for these 3 fields, is somewhat confusing.
Use Case
I extract and sync my Salesforce object metadata in an external database. I need an immutable unique identifier for my EntityDefinition
and FieldDefinition
objects, and unlike other objects, the Id
field on these objects is not a unique identifier.
DurableId
This seems like the right field to use. The documentation for this field on both objects' pages states:
Unique identifier for the field. Always retrieve this value before using it, as the value isn’t guaranteed to stay the same from one release to the next. To simplify queries, use this field.
Across releases then, the object's DurableId
value is mutable?
And the phrase "always retrieve this value before using it" confuses me.
If I have the following FieldDefintion object stored in my database:
DurableId
= Account.00N5e000007f9gt
unless I know that no 'release' has occurred since I last extracted metadata, there's no guarantee that the same object in Salesforce has the same DurableId
?
If that's true, then it seems that the unique identifier for a FieldDefinition
or EntityDefinition
object is the DurableId PLUS some form of Api version number, or am I not understanding what a release is?
DeveloperName
The FieldDefinition.DeveloperName definition states:
"The unique name of the object in the API"
Will EntityDefinitionId + DeveloperName
give me an immutable unique identifier for a FieldDefinition object?
QualifiedApiName
"A unique external name for the field"
When evaluating the FieldDefinition
object's data, I did some data profiling of my extracted metadata and the combination of EntityDefinitionId + QualifiedApiName
gave me a unique record.
So maybe those two fields will work?