How to use N/runtime Module in Netsuite for User Details?

Hi,

Netsuite N/runtime module provide methods to get user inside script, these are very useful if you want to set current logged in user into any field on record or if you want to use email id of current user etc.

** Please Note: If user event script or suitelet script triggered because of Scheduled Script or scheduled Map Reduce Script, it will not return any user id instead return system as script is triggered by system not by user.

var userObject = runtime.getCurrentUser();

To get User Contact:

 var contact = userObject.contact ;

To get User Department :

 var department = userObject.department ;

To get User Email:

var userEmail = userObject.email ;

To get User Id:

 var userId = userObject.id;

To get User Location:

 var userLocation = userObject.location;

To get User Name:

var userName = userObject.name;

To get  User Role:

 var userRole = userObject.role;

To get  User Subsidiary:

var userSubs = userObject.subsidiary

 

If you are triggering another script from user event (or other script) , you can pass required details using parameters also.

There are lot of methods to cover in N/runtime module, we will be updating this post for few more days, Stay Tuned...

Hope this will help you, let us know if you have any query in any of our social media platform.

 

 Thanks

Netsuite Guru

 

Download Netsuite Guru Android App
Follow Us on Linkedin
Our FB Page

Comments