Andy in the Cloud

From BBC Basic to and beyond…

10 thoughts on “Building Robust Dynamic Code with Custom Metadata Field Relationships

  1. Is there anything else required to activate the field definitions .It only shows entity definitions and I am on Spring 17 org

  2. Hi Andy,
    Thank you for this great article on this feature. Also thanks for the various links which are highly useful for understanding the concept. I was always wondering why did Salesforce release Custom Metadata when there is Custom Settings; now I have stronger points to support.

    • No worries Abhilash, glad it help express the value for you. Metadata Relationships have really given the feature a “value” boost for sure!

  3. Another cool use case for this is to define a list of fields via a set of custom metadata type rows that should be cleared on a clone operation. Often one has ‘system-y’ type fields created by triggers/workflows that simply don’t apply on a clone operation (for example, cloning an Opportunity and clearing the PO_Number__c field). The admin can add to the list of __mdt rows without ever having to touch the underlying apex code

  4. Hi Andy,

    I am unable to have the look up icon shoe up on the custom UI page, the doesnt seem to work. Also I am trying to show the Developer name of in the reference field instead of the record ID. Any thoughts?

    • Sorry I am not sure of the context of your question here? What are you doing?

      • I am so sorry that my comment was not neatly constructed.

        I am unable to have the look up icon show on the custom UI page. The binding doesn’t seem to work. I am being forced to use while attempting to show the Developer name of the reference field instead of the record ID which is currently showing up. Further, on save or update on the record from the UI, it throws an error, invalid reference field and is unable to save the record(But the ID in the reference field is the correct ID to the related metadata type).

        I have built my UI based off one of ur posts about custom UI for Custom Metadata Type. My understanding is the code in that post was to support v34.0 and relationships came out with v39.0. We are trying to generate a new Metadata Service Class from the Metadata API, but are having trouble saving it. Do you have any ideas on on implementing the look up icon on the VF page?

      • I see, so sadly VF apex:inputField is not supported with Custom Metadata Typre fields. So you cannot get the usual lookup icon to display with MD relationships. You will have to build your own drop down list box.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s