You need to sign in to do that
Don't have an account?
lavara
Access Custom Metadata Types through Visualforce
How do we access Custom Metadata Types through Visualforce? I couldn't find any relevant article that covers this to the point. I have a requirement, where I need to reference the custom MDT and populate variable values in the VF page based on the MDT value. Have read that we could use remote objects to do that. Any help on that would be appreciated.
PS: We are not using any custom controllers for this VF page.
PS: We are not using any custom controllers for this VF page.
I think the data in Custom Metadata Types can be accessed only by SOQL. Since you are not using custom controller, use Ajax to run the query to access the data. Something like below. Follow the link below to know more about querying in vf using Ajax.
https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm (https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm" target="_parent)
Custom Metadata Types - Guide
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadatatypes.htm (https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm" target="_parent)
Custom Metadata Types Implementation Guide.
https://resources.docs.salesforce.com/218/latest/en-us/sfdc/pdf/custom_metadata_types_impl_guide.pdf
If your question was about $Setup.[customSetting].[field], it is only used when referencing a custom setting of type “hierarchy” and not for custom metadata types.
Comments or corrections are appreciated.
Regards,
Kumar