You need to sign in to do that
Don't have an account?
Phuc Nguyen 18
Custom Medadata Type in Aura component
Currently have an aura component where the Salesforce object is hard coded in the cmp and design file.
Is there a way to use a CMT set by the user to determine object? So if the cmt value is Contact pass in Contact or if Account pass in Account and so on.
I know I can create a controller to query the cmt but now sure how to utilize it in the component
Is there a way to use a CMT set by the user to determine object? So if the cmt value is Contact pass in Contact or if Account pass in Account and so on.
I know I can create a controller to query the cmt but now sure how to utilize it in the component
@AuraEnabled public static List < File_Object__mdt > fetchObject() { return [ SELECT object__c FROM file_Object__mdt ]; }
Apex class:
Component:
Controller:
If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!
Anudeep
All Answers
Apex class:
Component:
Controller:
If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!
Anudeep
Do you know how I can reference the mdt value in the Design file? I am getting an error.
bids\main\default\aura\FileShare\FileShare.cmp The flexipage:availableForRecordHome interface doesn't support these attribute types in the design resource: file_Object__mdt []
The new custom field in the mdt is a text field