How to create a parenthetical OR group and add it ...
# ask-stanley-ai
a
How to create a parenthetical OR group and add it to an existing loaded saved search object in SuiteScript 2.1
c
AI generated answer (using internal Slack threads):
To create a parenthetical OR group and add it to an existing loaded saved search object in SuiteScript 2.1, you can use the 'use expressions' feature in the search criteria. This allows you to group multiple criteria together and apply logical operators such as OR and AND. Here is a simple example of how you can do this:
Copy code
javascript
var searchObj = search.load({
    id: 'customsearch_my_search'
});

searchObj.filterExpression = [
    ['tranid', 'is', 'value1'], 
    'OR', 
    ['tranid', 'is', 'value2']
];

var resultSet = searchObj.run();
In this example, the filterExpression property is used to set the search criteria. The criteria is an array where each element represents a condition. The 'OR' operator is used to create a parenthetical OR group. This means that the search will return results where either 'tranid' is 'value1' or 'tranid' is 'value2'. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828245878
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821755528
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808651447
Please provide your feedback on this answer.