function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DamonDamon 

Global Variable used by Application?

Hi all,

I'm relatively new to Salesforce development so I apologize in advance if this is an obvious question...  Here's the deal:  I'm using a web services call to integrate with an external application (via Javascript -> APEX) and I need to store authentication credentials within Salesforce.  These credentials are for authentication to the web service and they will be the same for all users within a given Salesforce implementation.  I don't want the administrators to have to enter the same username and password for every User they create so I'm trying to find a way to store the data once and reference it from JavaScript or the APEX classes.  Has anyone done this?

I've search for "global variable", "shared variable", "application-specific configuration", etc. but the results are not useful.  One thought was extending the "Setup" items to include some application-specific data but I can't find a way to do this anywhere.  I even thought about using a Static Resource but that seems unnecessarily cumbersome; I'd have read the file every time a web services call was made.

Any suggestions would be much-appreciated.

Thanks,

Damon
ad75ad75
It's a good question.  As far as I know there is no dedicated mechanism for storing config values at the moment.  There is an idea on the ideaexchange about adding this as a new feature.  I think an approach that some people use at the moment is to create a custom table to store the values you need, so that they are accessible using apex code or the api.  The table could simply have two columns, name and value, so that you can store as many config values as you like.