Gabriel Folstein
11/05/2024, 5:39 PMCeligo AI
11/05/2024, 5:39 PMAI generated answer (using internal Slack threads):To use the "params" parameter of the runSuiteQL method with multiple parameters, you need to pass an array of values that correspond to the placeholders in your SQL query. The placeholders are represented by the
?
symbol in your SQL statement. The order of the elements in the params array should match the order of appearance of the ?
in the query.
Here is an example:
javascript
query.runSuiteQL({
query: 'SELECT * FROM transaction WHERE statusref = ? AND entity = ?',
params: [ 'A', 123 ]
});
In this example, 'A' replaces the first ?
and 123 replaces the second ?
in the SQL query.
If you are using an "IN" clause in your SQL statement and you want to pass an array of values, you can use the join
method to create a string of values separated by commas. Here is an example:
javascript
var items = ['item1', 'item2', 'item3'];
var sql = `SELECT * FROM transaction WHERE item.ID IN ('${items.join("', '")}')`;
In this example, the join
method is used to create a string of item IDs separated by commas and enclosed in single quotes, which is then inserted into the SQL query.
******
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
11/05/2024, 5:40 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864189327
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835841417
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823447526
Celigo AI
11/05/2024, 5:40 PMCeligo AI
11/05/2024, 5:41 PM