Imran Hasan
09/11/2024, 8:04 AMCeligo AI
09/11/2024, 8:04 AMAI generated answer (using internal Slack threads):Based on the conversations, to create a button that redirects to a saved search in NetSuite, you can use the
window.open
or window.location
methods in your client script. Here's an example of how you can do this:
javascript
define(['N/search'], function (search) {
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
var exports = {};
function pageInit(context) {
// TODO
}
function myButton(context){
window.open('<https://xxxxx.app.netsuite.com/app/common/search/savedsearch.nl?id=1620>');
}
exports.myButton = myButton;
exports.pageInit = pageInit;
return exports;
});
In this example, when the button is clicked, it will open a new browser tab and navigate to the URL of the saved search. Replace '<https://xxxxx.app.netsuite.com/app/common/search/savedsearch.nl?id=1620>'
with the URL of your saved search.
If you want to add a filter to the saved search, you can add it as a URL parameter. For example:
javascript
function myButton(context){
window.open('<https://xxxxx.app.netsuite.com/app/common/search/savedsearch.nl?id=1620&CUSTBODY_MY_FIELD=6000>');
}
In this example, CUSTBODY_MY_FIELD=6000
is the additional filter. You might need to add the field as an available filter to the search.
******
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
09/11/2024, 8:05 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852792084
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843571544
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840672791
Celigo AI
09/11/2024, 8:05 AM