Basics
SuiteScript Operators
SuiteScript Operators
SuiteScript operators include arithmetic and logical extending JavaScript.
Introduction to SuiteScript Operators
SuiteScript, a JavaScript-based API for NetSuite, utilizes operators to perform calculations, comparisons, and logical operations. While many of these operators are inherited from JavaScript, SuiteScript adds some unique features tailored for business logic. This section explores the key operators you can use in SuiteScript.
Arithmetic Operators
Arithmetic operators in SuiteScript are used to perform mathematical calculations. These include addition, subtraction, multiplication, division, and modulus.
Logical Operators
Logical operators are used to evaluate expressions and return a Boolean value. They are essential for control flow in SuiteScript.
&&
- Logical AND||
- Logical OR!
- Logical NOT
These operators are especially useful in conditional statements.
Comparison Operators
Comparison operators are used to compare two values. These operators return a Boolean value based on the comparison.
==
- Equal to!=
- Not equal to===
- Strict equal to!==
- Strict not equal to>
- Greater than<
- Less than>=
- Greater than or equal to<=
- Less than or equal to
These are often used in loops and conditional statements to control the flow of logic.
Special SuiteScript Operators
In addition to standard JavaScript operators, SuiteScript offers special operators to handle specific NetSuite-related tasks. These operators can be used for handling record IDs, searching records, and more. Details of these operators can be found in the SuiteScript documentation.
Conclusion
Understanding SuiteScript operators is crucial for effective scripting in NetSuite. By leveraging these operators, you can create powerful and efficient scripts to automate and enhance your business processes.
Basics
- Previous
- Data Types
- Next
- If Else