I am using custom metadata with a field of type Metadata Relationship(Field Definition)
to provide the config side of an app, however when selecting Contact
as the object I cannot find the FirstName
or LastName
fields. Is this a bug, is there a way around this?
-
Are you sure they're not just somewhere else in the list? Sorting gets a little off sometimes it seems.– Adrian Larson ♦Mar 19, 2018 at 21:22
-
@AdrianLarson I just checked. It's not there...– sfdcfoxMar 19, 2018 at 21:24
2 Answers
It appears that Compound Fields are not supported except by their "name pointing" field. For example, you can't select Mailing State, but you can select Mailing Address. I'm still looking for a specific document that states this, but it's obviously a limitation of the current implementation.
-
Hmm pretty sure I was able to use
Account.BillingCity
,Account.BillingState
, etc. They all usedBillingAddress
as the label but did point to the component fields.– Adrian Larson ♦Mar 19, 2018 at 21:30 -
@AdrianLarson I've checked a few different fields, they don't appear as options when I try.– sfdcfoxMar 19, 2018 at 21:32
-
@sfdcfox thanks for confirming I am not going mad. I can work around it but have to add object/field specific check to what would be a pure dynamic method otherwise :(– GirbotMar 19, 2018 at 21:44
I know this one is a bit old, but found this today that might help.
Whenever you create a Metadata Relationship to Entity Definition (to get a picklist with the SObjects) you get the option to create two additional Metadata Relationships
- Field Definition
- Entity Particle
When choosing Entity Particle that gives you a picklist with all fields including compound fields (FirstName, LastName)