creates a sublist whose lines are of type T

Type Parameters

Hierarchy

  • Sublist

Indexable

[i: number]: T

Constructors

  • Constructs a new array-like representation of a NS sublist.

    Type Parameters

    Parameters

    • sublistLineType: (new (sublistId: string, nsrec: Record, line: number) => T)

      the type (should be a class extending SublistLine) to represent individual rows of this sublist

        • new (sublistId: string, nsrec: Record, line: number): T
        • Parameters

          • sublistId: string
          • nsrec: Record
          • line: number

          Returns T

    • rec: Record

      the NS nativerecord.Record instance to manipulate

    • sublistId: string

      name of the sublist we're representing

    Returns Sublist<T>

Properties

_useDynamicModeAPI: boolean
nsrecord: Record
sublistId: string

name of the sublist we're representing

sublistLineType: (new (sublistId: string, nsrec: Record, line: number) => T)

Type declaration

    • new (sublistId: string, nsrec: Record, line: number): T
    • the type (should be a class extending SublistLine) to represent individual rows of this sublist

      Parameters

      • sublistId: string
      • nsrec: Record
      • line: number

      Returns T

Accessors

  • get length(): number
  • array-like length property (linecount)

    Returns

    number of lines in this list

    Returns number

  • get useDynamicModeAPI(): boolean
  • If true and the underlying netsuite record is in dynamic mode, uses the dynamic APIs to manipulate the sublist (e.g. getCurrentSublistValue()) If false uses 'standard mode' (e.g. getSublistValue()) Defaults to true if the record is in dynamic mode. Set this to false prior to manipulating the sublist in order to force standard mode API usage even if the record is in 'dynamic mode'

    Returns boolean

  • set useDynamicModeAPI(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • adds a new line to this sublist at the given line number.

    Parameters

    • ignoreRecalc: boolean = true

      set true to avoid line recalc

    • insertAt: number = ...

      optionally set line # insertion point - defaults to insert at the end of the sublist. If in dynamic mode this parameter is ignored (dynamic mode uses selectNewLine()). The insertion point should be <= length of the list

    Returns T

  • commits the currently selected line on this sublist. When adding new lines in standard mode you don't need to call this method

    Returns void

  • Gets the NetSuite metadata for the given sublist field. Useful when you want to do things like disable a sublist field or other operations on the field itself (rather than the field value/text) Note: this uses the first sublist line (0) when retrieving field data

    Parameters

    • field: keyof T

      name of the desired sublist field

    Returns Field

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

  • upserts the indexed props (array-like structure) This is called once at construction, but also as needed when a user dynamically works with sublist rows.

    Returns void

  • Removes all existing lines of this sublist, leaving effectively an empty array

    Parameters

    • ignoreRecalc: boolean = true

      passed through to nsrecord.removeLine (ignores firing recalc event as each line is removed )

    Returns Sublist<T>

  • removes a line at the given index. Note this causes the array to rebuild.

    Parameters

    • line: number
    • ignoreRecalc: boolean = false

    Returns void

  • Selects the given line on this sublist

    Parameters

    • line: number

      line number

    Returns void

  • Returns any[]

Generated using TypeDoc