query.Period

Object Description

A period of time to use in query conditions.

Use query.createPeriod(options) to create this object. After you create this object, you can use it in the values parameter of Query.createCondition(options) or Component.createCondition(options).

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/query Module

Methods and Properties

Period Object Members

Since

2020.1

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.

            // Add additional code
...
    var myPeriod = query.createPeriod({
        code: query.PeriodCode.LAST_PERIOD,
        adjustment: query.PeriodAdjustment.ALL,
        type: query.PeriodType.END
    });

    // myQuery is an existing query.Query object
    var myComplexCondition = myQuery.createCondition({
        fieldId: 'trandate',
        operator: query.Operator.BEFORE,
        values: [myPeriod]
    });
...
// Add additional code 

          

Related Topics

General Notices