search.createFilter({ name: 'accountingperiod.clos...
# ask-stanley-ai
i
search.createFilter({ name: 'accountingperiod.closed', operator: search.Operator.IS, values: 'F' }) results in error "type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_FILTER","message":"An nlobjSearchFilter contains invalid search criteria: accountingperiod.closed.", on item fulfillment search The criteria was exported from an existing UI search
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that the error you're encountering is due to the invalid search criteria
accountingperiod.closed
. In NetSuite, not all fields are searchable or filterable, and it appears that
accountingperiod.closed
is one of them. In the first thread, the user was trying to use filter expressions when searching by dates and encountered a similar error. The solution was to correct the syntax of the filter expression, specifically removing the square brackets around the 'AND' operator. In the second thread, the user was trying to filter a sales order search by item and encountered an error. The solution was to convert the item ID to a string before using it in the filter. In the third thread, the user was trying to filter sales orders by status and encountered an error. The solution was to create the search in the UI first, then copy it into the script. It was also pointed out that 'closed' is not a valid option for the status field. In your case, you might need to find an alternative way to filter by whether an accounting period is closed or not. You could try creating the search in the UI first and then copying it into the script, as suggested in the third thread. ****** 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.863232315
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.860524356
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859967053
Please provide your feedback on this answer.
Thank you for your feedback
Thank you for your feedback