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 Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category