[SalesForce] Get IP addresses from Network Access

I want to get the IP address from Setup -> Network Access in my code, but I don't find a object to query, how can I query for it in Apex?

Best Answer

The records are represented by the IpWhitelist object, but they cannot be queried for. How did I figure out the name of the object? Go to the edit view for one of them and pass its Id to the following in Execute Anonymous:

system.debug(Id.valueOf('05G000000000000AAA').getSObjectType());

I tried querying in the console with and without the Tooling API and got:

sObject type 'IpWhitelist' is not supported.

Related Topic