ConditionalFormat Object Members in SuiteScript

The ConditionalFormat object in SuiteScript enables dynamic formatting of workbooks using customizable rules for better data visualization.

·2 min read·View Oracle Docs

The ConditionalFormat object in SuiteScript is essential for creating dynamic workbook visualizations through conditional formatting rules. This allows developers to enhance data presentation based on specific criteria, making reports more accessible and insightful.

What is the ConditionalFormat Object?

The ConditionalFormat object encapsulates a set of formatting rules that can be applied to workbook data. Developers commonly use this object within SuiteScript to create visually impactful analytics by applying conditions to data cells.

How to Create a ConditionalFormat Object

You can create a ConditionalFormat object using the workbook.createConditionalFormat(options) method. This method requires configuration options that specify the formatting rules to be applied.

Syntax Example

Below is a sample syntax of creating a ConditionalFormat object:

suitescript
// myConditionalFormat is a workbook.ConditionalFormat object
var myConditionalFormat = workbook.createConditionalFormat({
rules: [formatrules] // array of previously created workbook.ConditionalFormatRule
});

Properties of ConditionalFormat

The main property of the ConditionalFormat object is:

Property NameReturn TypeDescription
rulesworkbook.ConditionalFormatRule[]The conditioning rules contained within the format object.

Supported Script Types

The ConditionalFormat object is supported in server scripts, enabling back-end manipulations and data definitions for workbook presentations.

Error Handling

When utilizing the ConditionalFormat object, it's essential to handle errors effectively:

  • NO_RULE_DEFINED: Indicates that the rules property is an empty array, meaning no conditions are set.
  • WRONG_PARAMETER_TYPE: This error occurs if you pass a parameter that isn't an array of workbook.ConditionalFormatRule objects.

Who This Affects

This information is crucial for:

  • Developers: Who implement advanced data visualizations in SuiteScript.
  • System Administrators: Responsible for maintaining workbook functionalities.

Key Takeaways

  • The ConditionalFormat object allows the application of dynamic formatting rules in workbook data presentations.
  • The rules property defines specific formatting conditions for data cells.
  • Understanding error codes is essential for debugging when working with ConditionalFormat objects.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Do I need a specific version of NetSuite to use the ConditionalFormat object?
The article does not specify any version requirements for the ConditionalFormat object, but it is a new feature in SuiteScript, so it is best to check compatibility with your current NetSuite version.
What are the prerequisites for using the ConditionalFormat object in SuiteScript?
To use the ConditionalFormat object, you need to be familiar with SuiteScript, particularly with workbook scripting and ConditionalFormatRule objects for defining formatting rules.
How do I handle errors when using the ConditionalFormat object?
When using the ConditionalFormat object, it's important to handle 'NO_RULE_DEFINED' and 'WRONG_PARAMETER_TYPE' errors, which indicate missing rules or incorrect parameter types, respectively.
Can ConditionalFormat objects be used in client scripts?
The article mentions that the ConditionalFormat object is supported in server scripts, indicating that it's primarily used for back-end tasks and not in client scripts.
Source: ConditionalFormat 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 →