Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
UserEvent Script-get values for button
HI There
I have a userevent script that is supposed to trigger a suitelet.
To do this, I have a button generated by the userevent that calls the suitelet.
This is userevent script correctly passes the id of the record that I am on (when the button is pressed).
However, I can't get the other field values to pass across as parameters.
Can you see where my script is wrong:
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define(["N/url"], function (url) {
function beforeLoad(context) {
try {
if (
context.type == context.UserEventType.CREATE ||
context.type == context.UserEventType.EDIT
) {
var recCurrent = context.newRecord;
} else {
var recCurrent = context.oldRecord;