0

I have a REST server running at AWS which takes the input from the configuration file present in it.

I would like to use the values from the configuration file through salesforce, leaving the dependency on AWS.

I will pass the parameters from salesforce to the REST server that would not be difficult through the Apex class but is there any way to create a configuration file in salesforce.

  • You can keep your configuration values in custom settings. Create a custom setting and fields according to your config file and update values in that. And use that custom setting while calling your service from Apex. – RSG Apr 18 '17 at 15:03
0

Unfortunately custom settings do not support the "Text Area (Long)" field type that would allow you to add a configuration file of up to 128k to an easy to create and update field. So that leaves you with the choices such as:

I've used a Document for this purpose to good effect in the past and the parent Folder object offers useful security options.

If your configuration file is JSON, you can use the pretty good JSON class to parse as required and if the JSON changes over time you can change the code as needed. (Tools like JSON2Apex can be useful or you can stick to using loose Map<String, Object> data types.)

If your configuration file is XML you can use the pretty good DOM classes to parse it in Apex.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.