PositionUnits Object Members in SuiteScript 2.1
PositionUnits object members define positions with specific units in SuiteScript, enhancing workbook functionality.
TL;DR Opening
The PositionUnits object in SuiteScript provides essential properties for defining a position with specific units and coordinates within a workbook. Understanding its members is crucial for effective script development.
What is the PositionUnits Object?
The PositionUnits object is used to define a position within a workbook using numeric values and associated units. It plays a significant role in various scripting contexts, particularly in the creation and manipulation of workbook elements.
PositionUnits Object Members
The following members are available within the workbook.PositionUnits object:
| Member Name | Type | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
PositionUnits.unit | string | string | Server scripts | The units for the position. |
PositionUnits.x | number | number | Server scripts | The x-coordinate of the position. |
PositionUnits.y | number | number | Server scripts | The y-coordinate of the position. |
How to Create a PositionUnits Object
To create a PositionUnits object, utilize the workbook.createPositionUnits(options) method:
1// Example of creating a PositionUnits object2var myPositionUnits = workbook.createPositionUnits({3 unit: workbook.Unit.CM,4 x: 3,5 y: 36});Important Properties
- unit: The property
PositionUnits.unitspecifies the measurement units for the position. This is critical for ensuring that the position is defined correctly in the context of workbook dimensions. - x: Represents the horizontal position. It is denoted as a numeric value.
- y: Represents the vertical position. It is also a numeric value.
Error Handling
Be mindful of the potential errors when working with the PositionUnits object:
INVALID_UNIT: Thrown if the specified value forunitis not included in theworkbook.Unitenumeration.WRONG_PARAMETER_TYPE: This occurs if the value specified is not of string type for theunitproperty.
Who This Affects
This information is particularly relevant for:
- Developers who are working with SuiteScript for custom workbook implementations.
- Administrators managing and scripting around workbook functionalities in NetSuite.
Key Takeaways
- The PositionUnits object is vital for defining positions within a workbook.
- It includes properties for units of measure, as well as x and y coordinates.
- Proper understanding and implementation can significantly enhance workbook functionality within SuiteScript.
Frequently Asked Questions (4)
What are the main components of the PositionUnits object in SuiteScript 2.1?
How do I create a PositionUnits object using SuiteScript 2.1?
What error might I encounter if I provide an unsupported unit in a PositionUnits object?
Are there any script types where the PositionUnits object can be used?
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.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- 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.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category