The addressbook 'subrecord'. In SS2.x this is mostly treated as a normal record object but you can't create or load one from scratch. Typically just reference this type on the appropriate address subrecord property. For example,

Example

- an NSDAL Customer instance can refer to the first address's subrecord simply as:

customer.addressbook[0].addressbookaddress.addr1

Example

  • defining custom addressbook subrecord fields.

// define custom fields on address subrecord (optional)
export class MyCustomAddressClass extends AddressBase {
// ... define custom address subrecord fields here
}

// tell the customer address sublist to use our custom subrecord class
export class MyAddressSublist extends CustomerAddressSublist {
@SublistFieldType.subrecord(MyCustomAddressClass)
addressbookaddress: MyCustomAddressClass
}

Hierarchy

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 AddressBase

  • 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 AddressBase

  • 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 AddressBase

Properties

_id: number

Netsuite internal id of this record

addr1: string
addr2: string
addr3: string
addressee: string
addrphone: string

note this field name differs from the 'records browser' documentation

addrtext: string
attention: string
city: string
country: string

Unlike other select fields which take a numeric internal id value, this one requires the country abbreviation as the key (e.g. 'US')

defaultValues?: object
nsrecord: Record

underlying netsuite record

override: boolean
state: string
zip: string

Accessors

  • get id(): number
  • Returns number

Methods

  • Persists this record to the NS database

    Returns

    Parameters

    • Optional enableSourcing: boolean
    • Optional ignoreMandatoryFields: boolean

    Returns number

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

    Returns string | Type

Generated using TypeDoc