Column Object Members in SuiteScript 2.1 for Searches
Column objects encapsulate search columns in SuiteScript 2.1, allowing effective data retrieval and manipulation in NetSuite search operations.
Starting with SuiteScript 2.1, the Column object facilitates the creation and management of search columns in NetSuite searches, enhancing data retrieval and manipulation capabilities for scripts.
Overview of the Column Object
The Column object in the N/search module encapsulates a single search column, allowing developers to define how data is fetched and structured in search results. This object can be created using the method search.createColumn(options) and can be included in a search.Search object during search creation or loading.
Key Features of the Column Object
- Encapsulation: The
Columnobject encapsulates the properties and methods for defining search columns. - Customizability: Users can utilize the various methods and properties to adjust column settings, such as applying formulas or defining sorting behavior.
- Integration with Result Objects: Many search result processing methods can utilize
Columnobjects directly, enhancing flexibility and convenience in handling search results.
Column Object Members
Here’s a quick overview of the available members (methods and properties) associated with the Column object:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Method | Column.setWhenOrderedBy() | search.Column | Client and server scripts | Determines the column from which the minimal or maximal value is derived. |
| Property | Column.formula | string | Client and server scripts | Formula used in the search column as a string. |
| Property | Column.function | string | Client and server scripts | Special function used in the search column. |
| Property | Column.join | string (read-only) | Client and server scripts | Join ID for the search column. |
| Property | Column.label | string | Client and server scripts | Label used for the search column, allowing customization. |
| Property | Column.name | string (read-only) | Client and server scripts | Internal name of the search column. |
| Property | Column.summary | string (read-only) | Client and server scripts | Summary type for the search column. |
Practical Usage Example
Here's a sample script snippet demonstrating how to create a search using a column with a formula:
1// Add additional code 2... 3search.create({4 type: search.Type.TRANSACTION,5 columns: [6 'trandate',7 'amount',8 'entity',9 'entity.firstname',10 'entity.email',11 search.createColumn({12 name: 'formulatext',13 formula: "{lastname}||', '||{firstname}"14 })15 ], 16 // Add additional code 17});This script generates transaction search results featuring a concatenated column of last and first names.
Conclusion
The Column object in SuiteScript 2.1 empowers developers to effectively manage and manipulate search data within NetSuite. Its functionalities enhance search operations, making it easier to customize and retrieve the desired results based on specific criteria.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- The
Columnobject is essential for defining search columns in SuiteScript. - It supports various methods and properties to customize search result presentation.
- Practical usage includes building complex columns with formulas for enriched data displays.
Frequently Asked Questions (4)
How can I create a custom search column using a formula in SuiteScript 2.1?
What types of scripts support the Column object in SuiteScript 2.1?
Can I modify the internal name of a Column object in a NetSuite search?
Is it possible to determine which column provides the minimal or maximal value using Column object methods?
Was this article helpful?
More in Searches
- Search for Sublist Line Fields With Dynamic Tables in NetSuite
Learn how to optimize search queries for sublist line fields in NetSuite using dynamic tables and SuiteQL.
- Filter Object Members in NetSuite SuiteScript
Gain insights into the Filter Object Members of the N/search module in NetSuite SuiteScript. Learn how to create and configure filters effectively.
- Search Column Syntax for SuiteScript 2.x in NetSuite
Search column syntax in SuiteScript 2.x allows encapsulation of fields in NetSuite searches, enhancing data retrieval capabilities.
- PagedData Object Members in NetSuite SuiteScript 2.0
PagedData provides efficient pagination for search results in SuiteScript, enabling effective handling of large data sets.
Advertising
Reach Searches Professionals
Put your product in front of NetSuite experts who work with Searches every day.
Sponsor This Category