Can we get all remote site settings in apex ?
I would like to check if a remote site setting exists or not.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Of course both options would require some serious understanding and adaption on your end.
The RemoteSiteSetting is not directly exposed in Apex. It is neither possible to query it, nor to instantiate it.
RemoteSiteSetting s = new RemoteSiteSetting();
results in Invalid Type
SELECT Id FROM RemoteSiteSetting
results in sObject type 'RemoteSiteSetting' is not supported.
If you use Salesforce Inspector (Chrome Extension) https://chrome.google.com/webstore/detail/salesforce-inspector/aodjmnfhjibkcdimpodiifdjnnncaafh?hl=en or other tool that allows you to query using the Tooling API, you can just query:
select id, SiteName, EndpointUrl from RemoteProxy
If using Salesforce inspector, make sure "Use Tooling API?" checkbox is checked.