Monday, November 14, 2016

How to get Ip Address of User in Apex?


1String ipAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
True-Client-IP has the value when the request is coming via the caching integration.
X-Salesforce-SIP has the value if there is no caching integration (sandbox, developer edition orgs) or via the secure url.

No comments:

Post a Comment