how to turn this into a filter in a search functio...
# ask-stanley-ai
n
how to turn this into a filter in a search function in suitescript 2.0 {"name":"inventorynumber","join":"itemnumber","operator":"is","values":["730199"],"isor":false,"isnot":false,"leftparens":0,"rightparens":0} in this function var lotSearch = search.create({ type: search.Type.TRANSACTION, filters: [ ['item', 'is', '7647'], 'AND', ['inventorynumber.itemnumber', 'is', '730199'], 'AND', ['location', 'anyof', '28'], 'AND', ['quantitycommitted', 'greaterthan', '0'] ], columns: ['quantity', 'tranid'] });
c
AI generated answer (using internal Slack threads):
Based on the provided Slack threads, to include the filter in the search function in SuiteScript 2.0, you can modify the filters array in your search.create function. The filter you provided can be translated into the SuiteScript 2.0 format as follows:
Copy code
javascript
['inventorynumber.itemnumber', 'is', '730199']
So, your function would look like this:
Copy code
javascript
var lotSearch = search.create({
    type: search.Type.TRANSACTION,
    filters: [
        ['item', 'is', '7647'],
        'AND',
        ['inventorynumber.itemnumber', 'is', '730199'],
        'AND',
        ['location', 'anyof', '28'],
        'AND',
        ['quantitycommitted', 'greaterthan', '0']
    ],
    columns: ['quantity', 'tranid']
});
This filter will search for transactions where the item is '7647', the inventory number's item number is '730199', the location is '28', and the quantity committed is greater than '0'. ****** 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.894485652
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.890532434
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.878772259
Please provide your feedback on this answer.