Si Hobbs
02/15/2025, 5:19 AMCeligo AI
02/15/2025, 5:19 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems like you're encountering an error when trying to use the 'anyof' filter on a text field in a SuiteScript search. This is because 'anyof' is not supported for text fields. Instead, you can use the 'is' operator with the 'OR' syntax to filter on multiple values. Here's an example of how you can do this:
javascript
[
["inventorynumber", "is", "SN1"],
"OR",
["inventorynumber", "is", "SN2"],
]
In this example, 'SN1' and 'SN2' are the inventory numbers you're searching for. You can add more conditions by continuing the pattern with 'OR' and another condition.
If you have a variable length array, you might need to write a function to build the filters dynamically.
Alternatively, you can use a formula with the 'in' operator. However, this might be slower, especially if you have a large dataset. Here's an example:
javascript
[
"formulanumeric: CASE WHEN {inventorynumber} IN ('SN1', 'SN1') THEN 1 ELSE 0 END",
"equalto",
"1",
]
In this example, 'SN1' and 'SN1' are the inventory numbers you're searching for. You can add more values by including them in the parentheses, separated by commas. If you have over 1000 values, you'll need to split them into multiple filters.
Remember, using the 'OR' method might be faster the larger the dataset gets, as formulas in criteria can slow the search down.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/15/2025, 5:20 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.868778825
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864398956
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861429811
Celigo AI
02/15/2025, 5:20 AM