Ron
12/12/2024, 8:50 PMCeligo AI
12/12/2024, 8:50 PMAI 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:
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.
******Celigo AI
12/12/2024, 8:50 PMSlack 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
Celigo AI
12/12/2024, 8:50 PM