LimitingFilter Object Members for SuiteScript Development

The LimitingFilter object enables filtering in SuiteScript workbooks by setting limits and selection criteria, essential for effective data handling.

·2 min read·View Oracle Docs

The LimitingFilter object is pivotal in SuiteScript development, particularly in scenarios requiring data manipulation through workbook creation. This object is essential when you want to filter results in pivot tables, allowing for finer control of how data is aggregated and displayed.

What is the LimitingFilter Object?

The LimitingFilter object is utilized in the workbook module to constrain the results generated by pivot tables. It is created using the workbook.createLimitingFilter(options) function and is passed as a parameter to the workbook.createPivot(options) method. This allows developers to filter and limit data effectively while creating custom reports.

Members of the LimitingFilter Object

The LimitingFilter object contains several members, each serving a unique purpose in the filtering process. Below is a detailed overview of its members:

Member NameTypeSupported Script TypesDescription
LimitingFilter.filteredNodesSelectorworkbook.PathSelector or workbook.DimensionSelectorServer scriptsDefines the specific criteria to filter selected nodes.
LimitingFilter.limitnumberServer scriptsSets the maximum number of records returned by the filter.
LimitingFilter.rowbooleanServer scriptsIndicates whether the filter operates on row axes.
LimitingFilter.sortBysArray<workbook.SortByDataDimensionItem> or Array<workbook.SortByMeasure>Server scriptsSpecifies the sorting order for the filtered results.

Example Syntax

The following code snippet demonstrates how to create a LimitingFilter object:

suitescript
1// Creating a limiting filter object
2var myLimitingFilter = workbook.createLimitingFilter({
3 row: true,
4 sortBys: [myMeasureSort],
5 limit: 12,
6 filteredNodesSelector: myDimensionSelector
7});

In this example, the limiting filter is set to allow a maximum of 12 records, with results sorted based on specified measurement criteria.

Error Handling

When working with LimitingFilter, be aware of potential error codes that may occur:

  • WRONG_PARAMETER_TYPE: This error is thrown if an invalid type is passed for the filteredNodesSelector property. Ensure it matches either workbook.PathSelector or workbook.DimensionSelector.

By incorporating LimitingFilter objects, SuiteScript developers can significantly enhance the capabilities of their data presentations, making it easier to work with large datasets by focusing on relevant information.

Key Considerations

  • The workbook.createLimitingFilter function requires familiarity with defining and limiting data selections.
  • Proper parameter types must be adhered to, ensuring the script runs without error.

This approach not only optimizes performance but also improves the user experience when interacting with data reports.

Frequently Asked Questions (4)

Does the LimitingFilter object apply to both SuiteScript client and server scripts?
The LimitingFilter object members are specifically supported in server scripts, not client scripts.
What happens if I pass an incorrect type to the filteredNodesSelector property in a LimitingFilter object?
If an invalid type is passed to the filteredNodesSelector property, the error code 'WRONG_PARAMETER_TYPE' will be thrown.
Do I need to configure anything before using LimitingFilter with pivot tables?
The LimitingFilter object requires understanding of how to define data selections and limit parameters, and proper parameter types must be used to avoid errors.
Can the LimitingFilter object be used to sort results in a pivot table?
Yes, the LimitingFilter object can specify the sorting order of filtered results using its sortBys member, which accepts sorting based on data dimensions or measures.
Source: LimitingFilter Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →