Discussions

Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Community Poll: What sort of content would you like to see more of?

UserEvent Script-get values for button

edited Oct 4, 2023 11:19AM in Ask A Guru 5 comments

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;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!

Leaderboard

Community Whiz

Quarter 2 (Apr-Jun 2024)

This Week's Leaders

This Month's Leaders

All Time Leaders