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

Create a trigger to get current IP address
I want to create a trigger when user make changes to record, then I want record their current IP. Does anybody know how that works?
Thanks
Thanks
You need to sign in to do that
Don't have an account?
You can try below code in VF page to get IP address. 'True-Client-IP' - when the request is coming via the caching integration.
'X-Salesforce-SIP' - when the request is not via caching integration (sandbox, developer edition orgs) or via the secure url.
Unfortunately triggers are not aware of Visualforce pages, they seem to operate a lot closer to the database (an educated guess really). What this means is that the system methods available for visualforce pages aren't going to do very much at a trigger level
https://developer.salesforce.com/forums/?id=906F00000008xy4IAA
I think you should check login history to get API Address in Trigger by below query Please let us know if this will help you.
Thanks,
Amit Chaudhary
All Answers
You can try below code in VF page to get IP address. 'True-Client-IP' - when the request is coming via the caching integration.
'X-Salesforce-SIP' - when the request is not via caching integration (sandbox, developer edition orgs) or via the secure url.
Unfortunately triggers are not aware of Visualforce pages, they seem to operate a lot closer to the database (an educated guess really). What this means is that the system methods available for visualforce pages aren't going to do very much at a trigger level
https://developer.salesforce.com/forums/?id=906F00000008xy4IAA
I think you should check login history to get API Address in Trigger by below query Please let us know if this will help you.
Thanks,
Amit Chaudhary