ConditionalFormat Object Members in SuiteScript
The ConditionalFormat object in SuiteScript enables dynamic formatting of workbooks using customizable rules for better data visualization.
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:
// myConditionalFormat is a workbook.ConditionalFormat objectvar myConditionalFormat = workbook.createConditionalFormat({ rules: [formatrules] // array of previously created workbook.ConditionalFormatRule});Properties of ConditionalFormat
The main property of the ConditionalFormat object is:
| Property Name | Return Type | Description |
|---|---|---|
rules | workbook.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 ofworkbook.ConditionalFormatRuleobjects.
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
rulesproperty defines specific formatting conditions for data cells. - Understanding error codes is essential for debugging when working with ConditionalFormat objects.
Frequently Asked Questions (4)
Do I need a specific version of NetSuite to use the ConditionalFormat object?
What are the prerequisites for using the ConditionalFormat object in SuiteScript?
How do I handle errors when using the ConditionalFormat object?
Can ConditionalFormat objects be used in client scripts?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
