SunShine
01/27/2025, 2:59 PMCeligo AI
01/27/2025, 2:59 PMAI generated answer (using internal Slack threads):To add filters using SuiteScript 2.x in a Suitelet, you can use the
filterExpression
property of the search object. This property allows you to get the existing filter expression and modify it by adding your own filter expression. Here's an example of how you can do this:
javascript
var expr = search.filterExpression;
expr.push(['your', 'added', 'filter']);
search.filterExpression = expr;
or
javascript
search.filterExpression = search.filterExpression.concat(['your', 'added', 'filter']);
Please note that you need to set the filterExpression
property rather than calling methods on it. This is because NetSuite implemented search.filters
and search.filterExpression
as getters and setters around an internal object.
If you're working with a Suitelet list, you can add fields to your Suitelet to choose your available filters and a submit button to generate a new page with your new filters. However, if you're using a list page instead of a form page, the only customization you get out of a list are buttons and client script. You can either make buttons that create popups to choose your filters, or you can use the client script to do DOM manipulations to add your fields.
******
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
01/27/2025, 2:59 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.860750496
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859434426
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845527649
Celigo AI
01/27/2025, 2:59 PMSunShine
01/27/2025, 3:01 PM