How to load configuration from custom meta data
I'm new to Salesforce and I'm trying to load my App's configuration using the recommended method of custom meta data. This is very poorly documented with most of the hits with Google being marketing material about how good it is but lacking good concrete examples of usage. These are the approaches I've tried, pulled from online examples, none worked for various reasons. I have two configurations defined, Thing_REST_stable
& Thing_REST_latest
.
Thing_REST_stable config;
System.debug('config : ' + config); // Null
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config); // Empty
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config); // Empty
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config); // fails to compile.
These configurations contain details such as the endpoint, version & credentials for external REST connections. The documentation for this is very poor: https://trailhead.salesforce.com/en/content/learn/modules/custom_metadata_types
- How do I load these configs with Apex?
- How do I select Thing_REST_stable in live code?
- How do I select Thing_REST_latest in my test code?
- Can you point out some good examples, documentation?
apex configuration custom-metadata custom-metadata-types
New contributor
add a comment |
I'm new to Salesforce and I'm trying to load my App's configuration using the recommended method of custom meta data. This is very poorly documented with most of the hits with Google being marketing material about how good it is but lacking good concrete examples of usage. These are the approaches I've tried, pulled from online examples, none worked for various reasons. I have two configurations defined, Thing_REST_stable
& Thing_REST_latest
.
Thing_REST_stable config;
System.debug('config : ' + config); // Null
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config); // Empty
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config); // Empty
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config); // fails to compile.
These configurations contain details such as the endpoint, version & credentials for external REST connections. The documentation for this is very poor: https://trailhead.salesforce.com/en/content/learn/modules/custom_metadata_types
- How do I load these configs with Apex?
- How do I select Thing_REST_stable in live code?
- How do I select Thing_REST_latest in my test code?
- Can you point out some good examples, documentation?
apex configuration custom-metadata custom-metadata-types
New contributor
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago
add a comment |
I'm new to Salesforce and I'm trying to load my App's configuration using the recommended method of custom meta data. This is very poorly documented with most of the hits with Google being marketing material about how good it is but lacking good concrete examples of usage. These are the approaches I've tried, pulled from online examples, none worked for various reasons. I have two configurations defined, Thing_REST_stable
& Thing_REST_latest
.
Thing_REST_stable config;
System.debug('config : ' + config); // Null
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config); // Empty
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config); // Empty
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config); // fails to compile.
These configurations contain details such as the endpoint, version & credentials for external REST connections. The documentation for this is very poor: https://trailhead.salesforce.com/en/content/learn/modules/custom_metadata_types
- How do I load these configs with Apex?
- How do I select Thing_REST_stable in live code?
- How do I select Thing_REST_latest in my test code?
- Can you point out some good examples, documentation?
apex configuration custom-metadata custom-metadata-types
New contributor
I'm new to Salesforce and I'm trying to load my App's configuration using the recommended method of custom meta data. This is very poorly documented with most of the hits with Google being marketing material about how good it is but lacking good concrete examples of usage. These are the approaches I've tried, pulled from online examples, none worked for various reasons. I have two configurations defined, Thing_REST_stable
& Thing_REST_latest
.
Thing_REST_stable config;
System.debug('config : ' + config); // Null
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config); // Empty
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config); // Empty
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config); // fails to compile.
These configurations contain details such as the endpoint, version & credentials for external REST connections. The documentation for this is very poor: https://trailhead.salesforce.com/en/content/learn/modules/custom_metadata_types
- How do I load these configs with Apex?
- How do I select Thing_REST_stable in live code?
- How do I select Thing_REST_latest in my test code?
- Can you point out some good examples, documentation?
apex configuration custom-metadata custom-metadata-types
apex configuration custom-metadata custom-metadata-types
New contributor
New contributor
edited 1 hour ago
New contributor
asked 4 hours ago
Martin of Hessle
183
183
New contributor
New contributor
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago
add a comment |
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Custom Metadata isn't just a drop-in configuration load/save system. It acts in most cases like other metadata objects and variables in Apex and is subject to exactly the same syntax and limitations. Most of the issues you have below have to do with Apex and SOQL syntax, rather than Custom Metadata as such.
If the API name of your Custom Metadata record is Thing_REST__mdt
, you must always refer to it as such. If you're maintaining more than one configuration, and a single record defines a configuration, you can populate the name of that configuration (such as Thing_REST_stable
) in the record's DeveloperName
field, and then query based on that field to access a specific configuration.
Examples
Thing_REST_stable config;
System.debug('config : ' + config);
This is an uninitialized variable, and like any other in Apex is null
. Thing_REST_stable
isn't the name of the metadata record, but might be the name of a specific configuration (as above).
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config);
Custom metadata objects instantiated in code are blank, much like sObjects. Custom metadata classes do not have static methods like Custom Settings that instantiate them for you. You'll get a syntax error here because Thing_REST_stable
and Thing_REST__mdt
aren't the same types.
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config);
This is closest to being correct, but SELECT *
is not valid SOQL, and you must use the full name of your object (Thing_REST__mdt
) in your FROM
clause. You might do
Thing_REST__mdt conf = [SELECT My_Field__c, My_Preference__c FROM Thing_REST__mdt WHERE DeveloperName = 'Thing_REST_stable'];
to source two specific fields from a defined configuration.
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config);
This is the same as the one above, but it's closer to being valid because you use your object's API name Thing_REST__mdt
in both locations.
Storing Credentials
The best place to store credentials in Salesforce is not Custom Metadata, which can be read by anyone who has View Setup and Configuration permission. It's a Named Credential, which securely protects the credentials and handles OAuth authentication for you.
Custom Metadata and Custom Settings records can only be secured from users and system administrators in the context of a Managed Package, where they can be set to Protected.
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
add a comment |
You can query custom metadata records with a simple SOQL and here is the syntax -
SELECT (ALL FIELDS WITH COMMA SEPARATED) FROM Thing_REST__mdt WHERE DeveloperName = '*metadata_record_developer_name*'
You can not use * like sql syntax. You have to provide all fields API names in the query.
Example :
String devName = 'Thing_REST_stable';
Thing_REST__mdt thingsRestSetting = [ SELECT MasterLabel, DeveloperName FROM Thing_REST__mdt WHERE DeveloperName =:devName ];
You can pass the record developer name in the devName variable based on your environment. If the environment is testing then devName will be set to "Thing_REST_latest".
You can learn more about custom metadata from here.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "459"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Martin of Hessle is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f244900%2fhow-to-load-configuration-from-custom-meta-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Custom Metadata isn't just a drop-in configuration load/save system. It acts in most cases like other metadata objects and variables in Apex and is subject to exactly the same syntax and limitations. Most of the issues you have below have to do with Apex and SOQL syntax, rather than Custom Metadata as such.
If the API name of your Custom Metadata record is Thing_REST__mdt
, you must always refer to it as such. If you're maintaining more than one configuration, and a single record defines a configuration, you can populate the name of that configuration (such as Thing_REST_stable
) in the record's DeveloperName
field, and then query based on that field to access a specific configuration.
Examples
Thing_REST_stable config;
System.debug('config : ' + config);
This is an uninitialized variable, and like any other in Apex is null
. Thing_REST_stable
isn't the name of the metadata record, but might be the name of a specific configuration (as above).
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config);
Custom metadata objects instantiated in code are blank, much like sObjects. Custom metadata classes do not have static methods like Custom Settings that instantiate them for you. You'll get a syntax error here because Thing_REST_stable
and Thing_REST__mdt
aren't the same types.
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config);
This is closest to being correct, but SELECT *
is not valid SOQL, and you must use the full name of your object (Thing_REST__mdt
) in your FROM
clause. You might do
Thing_REST__mdt conf = [SELECT My_Field__c, My_Preference__c FROM Thing_REST__mdt WHERE DeveloperName = 'Thing_REST_stable'];
to source two specific fields from a defined configuration.
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config);
This is the same as the one above, but it's closer to being valid because you use your object's API name Thing_REST__mdt
in both locations.
Storing Credentials
The best place to store credentials in Salesforce is not Custom Metadata, which can be read by anyone who has View Setup and Configuration permission. It's a Named Credential, which securely protects the credentials and handles OAuth authentication for you.
Custom Metadata and Custom Settings records can only be secured from users and system administrators in the context of a Managed Package, where they can be set to Protected.
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
add a comment |
Custom Metadata isn't just a drop-in configuration load/save system. It acts in most cases like other metadata objects and variables in Apex and is subject to exactly the same syntax and limitations. Most of the issues you have below have to do with Apex and SOQL syntax, rather than Custom Metadata as such.
If the API name of your Custom Metadata record is Thing_REST__mdt
, you must always refer to it as such. If you're maintaining more than one configuration, and a single record defines a configuration, you can populate the name of that configuration (such as Thing_REST_stable
) in the record's DeveloperName
field, and then query based on that field to access a specific configuration.
Examples
Thing_REST_stable config;
System.debug('config : ' + config);
This is an uninitialized variable, and like any other in Apex is null
. Thing_REST_stable
isn't the name of the metadata record, but might be the name of a specific configuration (as above).
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config);
Custom metadata objects instantiated in code are blank, much like sObjects. Custom metadata classes do not have static methods like Custom Settings that instantiate them for you. You'll get a syntax error here because Thing_REST_stable
and Thing_REST__mdt
aren't the same types.
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config);
This is closest to being correct, but SELECT *
is not valid SOQL, and you must use the full name of your object (Thing_REST__mdt
) in your FROM
clause. You might do
Thing_REST__mdt conf = [SELECT My_Field__c, My_Preference__c FROM Thing_REST__mdt WHERE DeveloperName = 'Thing_REST_stable'];
to source two specific fields from a defined configuration.
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config);
This is the same as the one above, but it's closer to being valid because you use your object's API name Thing_REST__mdt
in both locations.
Storing Credentials
The best place to store credentials in Salesforce is not Custom Metadata, which can be read by anyone who has View Setup and Configuration permission. It's a Named Credential, which securely protects the credentials and handles OAuth authentication for you.
Custom Metadata and Custom Settings records can only be secured from users and system administrators in the context of a Managed Package, where they can be set to Protected.
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
add a comment |
Custom Metadata isn't just a drop-in configuration load/save system. It acts in most cases like other metadata objects and variables in Apex and is subject to exactly the same syntax and limitations. Most of the issues you have below have to do with Apex and SOQL syntax, rather than Custom Metadata as such.
If the API name of your Custom Metadata record is Thing_REST__mdt
, you must always refer to it as such. If you're maintaining more than one configuration, and a single record defines a configuration, you can populate the name of that configuration (such as Thing_REST_stable
) in the record's DeveloperName
field, and then query based on that field to access a specific configuration.
Examples
Thing_REST_stable config;
System.debug('config : ' + config);
This is an uninitialized variable, and like any other in Apex is null
. Thing_REST_stable
isn't the name of the metadata record, but might be the name of a specific configuration (as above).
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config);
Custom metadata objects instantiated in code are blank, much like sObjects. Custom metadata classes do not have static methods like Custom Settings that instantiate them for you. You'll get a syntax error here because Thing_REST_stable
and Thing_REST__mdt
aren't the same types.
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config);
This is closest to being correct, but SELECT *
is not valid SOQL, and you must use the full name of your object (Thing_REST__mdt
) in your FROM
clause. You might do
Thing_REST__mdt conf = [SELECT My_Field__c, My_Preference__c FROM Thing_REST__mdt WHERE DeveloperName = 'Thing_REST_stable'];
to source two specific fields from a defined configuration.
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config);
This is the same as the one above, but it's closer to being valid because you use your object's API name Thing_REST__mdt
in both locations.
Storing Credentials
The best place to store credentials in Salesforce is not Custom Metadata, which can be read by anyone who has View Setup and Configuration permission. It's a Named Credential, which securely protects the credentials and handles OAuth authentication for you.
Custom Metadata and Custom Settings records can only be secured from users and system administrators in the context of a Managed Package, where they can be set to Protected.
Custom Metadata isn't just a drop-in configuration load/save system. It acts in most cases like other metadata objects and variables in Apex and is subject to exactly the same syntax and limitations. Most of the issues you have below have to do with Apex and SOQL syntax, rather than Custom Metadata as such.
If the API name of your Custom Metadata record is Thing_REST__mdt
, you must always refer to it as such. If you're maintaining more than one configuration, and a single record defines a configuration, you can populate the name of that configuration (such as Thing_REST_stable
) in the record's DeveloperName
field, and then query based on that field to access a specific configuration.
Examples
Thing_REST_stable config;
System.debug('config : ' + config);
This is an uninitialized variable, and like any other in Apex is null
. Thing_REST_stable
isn't the name of the metadata record, but might be the name of a specific configuration (as above).
Thing_REST__mdt config = new Thing_REST_stable();
System.debug('config : ' + config);
Custom metadata objects instantiated in code are blank, much like sObjects. Custom metadata classes do not have static methods like Custom Settings that instantiate them for you. You'll get a syntax error here because Thing_REST_stable
and Thing_REST__mdt
aren't the same types.
Thing_REST__mdt conf = [SELECT * FROM Thing_REST_stable];
System.debug('config : ' + config);
This is closest to being correct, but SELECT *
is not valid SOQL, and you must use the full name of your object (Thing_REST__mdt
) in your FROM
clause. You might do
Thing_REST__mdt conf = [SELECT My_Field__c, My_Preference__c FROM Thing_REST__mdt WHERE DeveloperName = 'Thing_REST_stable'];
to source two specific fields from a defined configuration.
Thing_REST__mdt config = new Thing_REST__mdt();
System.debug('config : ' + config);
This is the same as the one above, but it's closer to being valid because you use your object's API name Thing_REST__mdt
in both locations.
Storing Credentials
The best place to store credentials in Salesforce is not Custom Metadata, which can be read by anyone who has View Setup and Configuration permission. It's a Named Credential, which securely protects the credentials and handles OAuth authentication for you.
Custom Metadata and Custom Settings records can only be secured from users and system administrators in the context of a Managed Package, where they can be set to Protected.
edited 1 hour ago
answered 2 hours ago
David Reed
29.9k61746
29.9k61746
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
add a comment |
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
Thanks a good answer, clear & too the point, sorry I don't have the score to up vote.
– Martin of Hessle
1 hour ago
add a comment |
You can query custom metadata records with a simple SOQL and here is the syntax -
SELECT (ALL FIELDS WITH COMMA SEPARATED) FROM Thing_REST__mdt WHERE DeveloperName = '*metadata_record_developer_name*'
You can not use * like sql syntax. You have to provide all fields API names in the query.
Example :
String devName = 'Thing_REST_stable';
Thing_REST__mdt thingsRestSetting = [ SELECT MasterLabel, DeveloperName FROM Thing_REST__mdt WHERE DeveloperName =:devName ];
You can pass the record developer name in the devName variable based on your environment. If the environment is testing then devName will be set to "Thing_REST_latest".
You can learn more about custom metadata from here.
add a comment |
You can query custom metadata records with a simple SOQL and here is the syntax -
SELECT (ALL FIELDS WITH COMMA SEPARATED) FROM Thing_REST__mdt WHERE DeveloperName = '*metadata_record_developer_name*'
You can not use * like sql syntax. You have to provide all fields API names in the query.
Example :
String devName = 'Thing_REST_stable';
Thing_REST__mdt thingsRestSetting = [ SELECT MasterLabel, DeveloperName FROM Thing_REST__mdt WHERE DeveloperName =:devName ];
You can pass the record developer name in the devName variable based on your environment. If the environment is testing then devName will be set to "Thing_REST_latest".
You can learn more about custom metadata from here.
add a comment |
You can query custom metadata records with a simple SOQL and here is the syntax -
SELECT (ALL FIELDS WITH COMMA SEPARATED) FROM Thing_REST__mdt WHERE DeveloperName = '*metadata_record_developer_name*'
You can not use * like sql syntax. You have to provide all fields API names in the query.
Example :
String devName = 'Thing_REST_stable';
Thing_REST__mdt thingsRestSetting = [ SELECT MasterLabel, DeveloperName FROM Thing_REST__mdt WHERE DeveloperName =:devName ];
You can pass the record developer name in the devName variable based on your environment. If the environment is testing then devName will be set to "Thing_REST_latest".
You can learn more about custom metadata from here.
You can query custom metadata records with a simple SOQL and here is the syntax -
SELECT (ALL FIELDS WITH COMMA SEPARATED) FROM Thing_REST__mdt WHERE DeveloperName = '*metadata_record_developer_name*'
You can not use * like sql syntax. You have to provide all fields API names in the query.
Example :
String devName = 'Thing_REST_stable';
Thing_REST__mdt thingsRestSetting = [ SELECT MasterLabel, DeveloperName FROM Thing_REST__mdt WHERE DeveloperName =:devName ];
You can pass the record developer name in the devName variable based on your environment. If the environment is testing then devName will be set to "Thing_REST_latest".
You can learn more about custom metadata from here.
edited 42 mins ago
codeyinthecloud
3,239423
3,239423
answered 2 hours ago
Naval Sharma
88228
88228
add a comment |
add a comment |
Martin of Hessle is a new contributor. Be nice, and check out our Code of Conduct.
Martin of Hessle is a new contributor. Be nice, and check out our Code of Conduct.
Martin of Hessle is a new contributor. Be nice, and check out our Code of Conduct.
Martin of Hessle is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f244900%2fhow-to-load-configuration-from-custom-meta-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What are the "Thing_REST_stable" and "Thing_REST_latest: in your code? What do you want to achieve through custom metadata?
– Naval Sharma
3 hours ago
I am trying to 'load my configuration', as per first sentence, they are the custom metadata objects, created via the UI.
– Martin of Hessle
3 hours ago
What is your use case mate? Looks like you want to query Custom Metadata?
– Naval Sharma
3 hours ago
I have an external REST interface and I do not want credentials in the code, I'm trying to load those, custom metadata seems to be the recommended way to do this, but loading configurations seems a pita in salesforce. This would be trivially easy in most languages. One line in java, System.getenv('endpoint')
– Martin of Hessle
2 hours ago