emptylineitemnumber(
emptylineitemnumber(
ITEM
)

The emptylineitemnumber( function returns the numeric suffix of the first matching line item field that is empty (if any).

Parameters

This function has one parameter:

item – root name of the line item. May include or exclude a suffix of Ω, but should not include a numeric suffix.

Description

This function returns the numeric suffix of the first matching line item field that is empty (if any). This example uses this function to fill the next empty line item in the current record with 1 Widget for $10.00.

    let nextItemNumber = emptylineitemnumber("Qty")
    set "Qty"+nextItemNumber,1
    set "Item"+nextItemNumber,"Widget"
    set "Price"+nextItemNumber,10.00
    set "Amount"+nextItemNumber,10.00

A related feature is the emptyfield statement, which makes the next empty line item the active field.

See Also

- count( -- counts all non-empty instances of a line item field in the current record.
- Line Item Fields -- are used for repeating items within a record
- sum( -- adds up all instances of a line item field in the current record.

History

Version | Status | Notes
10.2 | New | New in this version.