PositionValues in SuiteScript for Custom Styles
The PositionValues object in SuiteScript defines values like LEFT and CENTER for precise custom 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
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- Enhancements to SuiteScript User Role Context Clarification
SuiteScript updates clarify the user and role contexts for script executions, improving deployment understanding and management.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category