You need to sign in to do that
Don't have an account?

Dynamic endpoints in salesforce callout
Endpoints are always hard coded in remote settings and in the code, Is there a way that endpoints which I am hard coding can be dynamic .
So that If Target System url changes , I need not to make changes in code
Any Idea how to achieve this functionality?
Thank you
So that If Target System url changes , I need not to make changes in code
Any Idea how to achieve this functionality?
Thank you
You can create a List type custom setting to accomplish this. Create one custom setting and one field in that custom setting to hold the value of endpoint url.
Example: You have created one custom setting named as 'Test' and created one field of type URL named as 'End Point URL'. After that create one custom setting record by clicking the 'Manage' button on custom setting detail page. Give the name as 'Integration' and store the value of end point in URL field.
In code you can do following:
FYI : This is a best practice to keep all hard coded values used within the code in the custom setting since these values could be changed when you migrate data from one org to another, probably from sandbox to production.
Thanks,
Pankaj