search.createColumn(options)
Method Description |
Creates a new search column as a search.Column object. A search column represents a field on a record. You create a column for each field that you want to include in the search results. For example, if you create a column for the Sales Rep field on a customer record and specify that column when you create a search, the value of the Sales Rep field is included in the search results.
Important:
As you create search columns, consider the following:
|
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
Name of the search column. See Column.name. |
2015.2 |
|
string |
optional |
Join ID for the search column. See Column.join. |
2015.2 |
|
string |
optional |
Summary type for the column. See search.Summary and Column.summary. |
2015.2 |
|
string |
optional |
Formula for the search column. See Column.formula. |
2015.2 |
|
string |
optional |
Special function for the search column. See Column.function. |
2015.2 |
|
string |
optional |
Label for the search column. See Column.label. |
2015.2 |
|
string |
optional |
The sort order of the column. Use the search.Sort enum for this argument. Also see Column.sort. |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
A search.Column object contains an invalid column summary type, or is not in proper syntax: {1}. |
The |
|
|
An unknown function is provided. |
|
{1}: Missing a required argument: {2} |
Required parameter is missing. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/search Module Script Samples.
//Add additional code
...
var currencyColumn = search.createColumn({
name: 'currency',
sort: search.Sort.ASC
});
...
//Add additional code