What suitescript module do I use to get current us...
# ask-stanley-ai
r
What suitescript module do I use to get current user
c
AI generated answer (using internal Slack threads):
To get the current user in SuiteScript, you can use the
N/runtime
module and the function
runtime.getCurrentUser()
. This function will return the user currently logged in. Here is an example of how you can use it:
Copy code
javascript
var runtime = require('N/runtime');
var user = runtime.getCurrentUser();
console.log(user.id); // prints the id of the current user
Please note that in the customer center,
currentUser.id
will give you the customer's ID (i.e. from the company); if you're looking for the ID of the specific contact that's logged in, you can get that from
currentUser.contact
. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800729632
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796483338
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.788632274
Please provide your feedback on this answer.