suitescript to create search for transaction with ...
# ask-stanley-ai
k
suitescript to create search for transaction with multiple filters with suitescript 1.0
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To create a search for a transaction with multiple filters using SuiteScript 1.0, you can use the
nlapiSearchRecord
function. Here is an example of how you can do it:
Copy code
javascript
var transactionSearch = nlapiSearchRecord("transaction",null,
[
   ["file.created","onorbefore","today"], 
   "AND", 
   ["mainline","is","T"]
], 
[
   new nlobjSearchColumn("tranid"), 
   new nlobjSearchColumn("internalid","file",null)
]
);
In this example, the search is created for the "transaction" type. The filters are set to find transactions where the file was created on or before today and where the mainline is true. The columns to be returned are "tranid" and the internal id of the file. Please note that the
nlapiSearchRecord
function is part of SuiteScript 1.0 API, and it might not be available or work differently in SuiteScript 2.0.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851257384
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844421446
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83795172
Please provide your feedback on this answer.
a
@KM Search for the NetSuite plugin (Chronium browsers) which allows you to export saved searches into 1.x or 2.x SuiteScript. It's a lifesaver 🙂
Create your search and export it. Paste it straight into your script
k
Thank you @Aly Actually I use it already but I just wanted to save time. Thank you anyway