Since the netsuite defined 'CurrentRecord' type has almost all the same operations as the normal 'Record' we use this as our base class

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Loads an existing record with the given internal id

    Example

    // load customer with internal id 123
    const c = new Customer(123)

    Parameters

    • id: NonNullable<string | number>

      record internal id to load

    • Optional isDynamic: boolean

      set true if you want to load the record in dynamic mode

    Returns NetsuiteCurrentRecord

  • Creates an NSDAL instance for the given existing NetSuite record object. This does NOT reload the record - it just wraps the supplied rec

    Example

    // assume `ctx` is the _context_ object passed to a `beforeSubmit()` entrypoint.
    // results in an NFT representation of the 'new record'
    const customer = new Customer(ctx.newRecord)

    Parameters

    • rec: NonNullable<ClientCurrentRecord | Record>

      an existing netsuite record

    Returns NetsuiteCurrentRecord

  • creates a new record

    Example

    // start a new customer record
    const c = new Customer()

    // start a new customer record in dynamic mode
    const c = new Customer(null, true)

    Parameters

    • Optional unused: Nullable<string | number>

      either null or leave this parameter out entirely

    • Optional isDynamic: boolean

      true if you want to create the record in dynamic mode, otherwise uses standard mode.

    • Optional defaultvalues: object

      optional defaultvalues object - specific to certain records that allow initializing a new record.

    Returns NetsuiteCurrentRecord

Properties

_id: number

Netsuite internal id of this record

defaultValues?: object
nsrecord: ClientCurrentRecord | Record

The underlying netsuite 'record' object. For client scripts, this is the slightly less feature rich 'ClientCurrentRecord' when accessing the 'current' record the script is associated to.

Accessors

  • get id(): number
  • Returns number

Methods

  • Defines a descriptor for nsrecord so as to prevent it from being enumerable. Conceptually only the field properties defined on derived classes should be seen when enumerating

    Parameters

    • value: any

    Returns this

  • Returns any

  • The netsuite record type (constant string) - this is declared here and overridden in derived classes

    Returns string | Type

Generated using TypeDoc