workbook.createStyle(options)

Note:

The content in this help topic applies to SuiteScript 2.x.

Method Description

Creates a style to be used for conditional formatting.

Returns

workbook.Style

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/workbook Module

Sibling Module Members

N/workbook Module Members

Since

2021.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.backgroundColor

workbook.Color | string

optional

The background color.

options.backgroundImage

string

optional

The background image.

options.backgroundPosition

workbook.PositionPercent | workbook.PositionUnits | workbook.PositionValues

optional

The background position.

options.color

workbook.Color | string

optional

The font color.

options.fontSize

string

optional

The font size.

options.fontStyle

string

optional

The font style.

options.fontWeight

string

optional

The font weight.

options.textAlign

string

optional

The alignment of text.

options.textDecorationColor

workbook.Color | string

optional

The text decoration color.

options.textDecorationLine

string

optional

The text decoration line.

options.textDecorationStyle

string

optional

The text decoration style.

Errors

Error Code

Thrown If

INVALID_COLOR

The value of any of the options.backgroundColor, options.color, or options.textDecorationColor parameters is not included in the workbook.Color enum and is not a workbook.Color object.

INVALID_FONT_SIZE

The value of the options.fontSize parameter is not included in the workbook.FontSize enum.

INVALID_FONT_STYLE

The value of the options.fontStyle parameter is not included in the workbook.FontStyle enum.

INVALID_FONT_WEIGHT

The value of the options.fontWeight parameter is not included in the workbook.FontWeight enum.

INVALID_IMAGE

The value of the options.backgroundImage parameter is not included in the workbook.Image enum.

INVALID_TEXT_ALIGN

The value of the options.textAlign parameter is not included in the workbook.TextAlign enum.

INVALID_TEXT_DECORATION_LINE

The value of the options.textDecorationLine parameter is not included in the workbook.TextDecorationLine enum.

INVALID_TEXT_DECORATION_STYLE

The value of the options.textDecorationStyle parameter is not included in the workbook.TextDecorationStyle enum.

Related Topics

N/workbook Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices