Published on May 24, 2019.
I'm currently working on a NetSuite integration project, and in one of the Suitelets, I need to get the remote IP address of the user or client.
An easy way to get the value is via the request headers. For example:
var ip = context.request.headers['ns-client-ip'];
There are several other interesting and potentially useful headers that are available, including the the user-agent (ex: "Mozilla/5.0"), the NetSuite host (ex: "startron11.extforms.netsuite.com"), and so on. To get a sense of what's available, log the headers, like this...
log.debug( { title: 'Headers', details: context.request.headers } );
Then review the script's Execution Log.
Hello, I'm Tim Dietrich. I develop custom software for businesses that are running on NetSuite, including mobile apps, Web portals, Web APIs, and more.
I'm the developer of several popular NetSuite open source solutions, including the SuiteQL Query Tool, SuiteAPI, and more.
I founded SuiteStep, a NetSuite development studio, to provide custom software and AI solutions - and continue pushing the boundaries of what's possible on the NetSuite platform.
Copyright © 2025 Tim Dietrich.