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.
Discover NetSuite's potential! Join our webinars, learn from experts, and optimize your operations. Whether you're experienced or new, secure your spot today and stay ahead in NetSuite!
Share with colleagues and friends who could benefit from our webinars too!

Why does getText not work on record creation?

edited Oct 30, 2023 7:49PM in Ask A Guru 7 comments

Hi there

I have a before record submit script that is supposed to run on a custom record and return an array of values called 'common values' if a value is found on more than one custom record:

 * @NApiVersion 2.x
 * @NScriptType UserEventScript
define(["N/record", "N/search"], function (record, search) {
   * @param {UserEventContext.beforeSubmit} context
  function beforeSubmit(context) {
    try {
      var approverRecord = context.newRecord;

      var returnType = approverRecord.getText({
        fieldId: "custrecord_type_of_return",

      log.debug("return type", returnType);

      var returnAuthAppr = search.create({
        type: "customrecord_ieturn_auth_approver",
        filters: [],
        columns: [
          search.createColumn({ name: "internalid", label: "Internal ID" }),
            name: "custrecord_first_approver",
            label: "First Approver",

Howdy, Stranger!

Log In

To view full details, sign in.


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


Community Whiz

Quarter 1 (Jan-Mar 2024)

This Week's Leaders

This Month's Leaders

All Time Leaders