PositionValues Object Members in SuiteScript for Custom Styles
The PositionValues object in SuiteScript allows defining precise positions like LEFT and CENTER for custom workbook styles.
The PositionValues object enables developers to specify precise positional values such as LEFT and CENTER in SuiteScript. This functionality is crucial for creating and manipulating styles dynamically within workbooks, enhancing the customization capabilities of reports and dashboards.
What Are PositionValues?
The PositionValues object allows for the definition of horizontal and vertical positioning in SuiteScript. You can create this object using the workbook.createPositionValues(options) method. It supports various script types, specifically server scripts.
PositionValues Object Members
The PositionValues object comprises the following properties:
| Member Name | Type | Description | Supported Script Types |
|---|---|---|---|
PositionValues.horizontal | string | The horizontal value of the position. | Server scripts |
PositionValues.vertical | string | The vertical value of the position. | Server scripts |
Usage Example
To use the PositionValues object, refer to the following code sample:
// Example of creating a PositionValues object var myPositionValues = workbook.createPositionValues({ horizontal: workbook.Position.CENTER, vertical: workbook.Position.LEFT });Error Handling
When implementing the PositionValues, be aware of the following potential error codes:
INVALID_POSITION: This error is thrown if the specified value for the horizontal or vertical property is not part of theworkbook.Positionenumeration.WRONG_PARAMETER_TYPE: This is triggered if the value assigned to the properties is not a string.
Related Resources
For additional guidance and examples, you might want to check:
- N/workbook Module
- Full scripts in the Tutorial: Creating a Workbook Using the Workbook API
Frequently Asked Questions (4)
What script types support the use of the PositionValues object in SuiteScript?
How can I create a PositionValues object in SuiteScript?
What error might occur if I specify an incorrect value for the PositionValues object in SuiteScript?
Is it possible to assign non-string values to the PositionValues properties in SuiteScript?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
