NetSuite FastTrack Toolkit (NFT) - v8.0.0
    Preparing search index...

    creates a sublist whose lines are of type T

    Type Parameters

    Indexable

    • [i: number]: T
    Index

    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

      • rec: Record

        the NS nativerecord.Record instance to manipulate

      • sublistId: string

        name of the sublist we're representing

      Returns Sublist<T>

    Properties

    nsrecord: Record
    sublistId: string

    name of the sublist we're representing

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

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

    Accessors

    • get length(): number

      array-like length property (linecount)

      Returns number

      number of lines in this list

    • 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

    • 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