Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I have a web service class that will be in a managed package and distributed to multiple clients. The class currently has a variable with the hardcoded value of the server it's hitting.

The problem: the server will be different for each client, so a hardcoded value will not work.

I figured since each client will have to add their server to their remote site settings, the easiest way might be to grab the correct URL from their setting. Is this possible? Or is there another "right" way to accomplish this? Thanks

1 Answer

0 votes
by (32.1k points)
edited by

You can save configuration values by using Apex Custom Settings. To set remote site settings programmatically, you have to use the Metadata API.

Want to learn Salesforce from basics! Here's the right video for you on Salesforce provided by Intellipaat:

Browse Categories

...