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.

·2 min read·View Oracle Docs

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 NameTypeDescriptionSupported Script Types
PositionValues.horizontalstringThe horizontal value of the position.Server scripts
PositionValues.verticalstringThe vertical value of the position.Server scripts

Usage Example

To use the PositionValues object, refer to the following code sample:

suitescript
// 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 the workbook.Position enumeration.
  • 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?
The PositionValues object is supported specifically in server scripts within SuiteScript.
How can I create a PositionValues object in SuiteScript?
You can create a PositionValues object using the method `workbook.createPositionValues(options)` where you define the horizontal and vertical positioning values.
What error might occur if I specify an incorrect value for the PositionValues object in SuiteScript?
You might encounter the `INVALID_POSITION` error if the specified horizontal or vertical value is not part of the `workbook.Position` enumeration.
Is it possible to assign non-string values to the PositionValues properties in SuiteScript?
No, if you assign a non-string value to the PositionValues properties, it will trigger the `WRONG_PARAMETER_TYPE` error.
Source: PositionValues Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →