skyline
skyline

Reputation: 473

How to know in which mode a record is by ClientScript on NetSuite?

We can use the following UserEventScript code to do detect which mode a record is in:

    switch (context.type) {
        case context.UserEventType.CREATE:
            break;
        case context.UserEventType.EDIT:
            break;
        case context.UserEventType.DELETE:
            break;
        default:
            break;
    }

But do we have any similar way to know that by ClientScript?

Upvotes: 0

Views: 2502

Answers (1)

ehcanadian
ehcanadian

Reputation: 1794

You can get the mode the record is in using the context.mode of the pageInit entry point.

mode can be copy, create, or edit.

  function pageInit(context) {
            if (context.mode !== 'create')
                return;
// do stuff
            });
        }

Upvotes: 2

Related Questions