Imran Hasan
09/11/2024, 9:25 AMCeligo AI
09/11/2024, 9:25 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems you want to create a button that, when clicked, redirects to a saved search and applies a dynamic filter using SuiteScript. Here's how you can achieve this: 1. Create a ClientScript that will be triggered when the button is clicked. In this script, you will use the
window.open
or window.location
function to redirect to the saved search URL.
2. To apply a dynamic filter, you can append the filter parameters to the URL of the saved search. For example, if you want to filter by a custom field, you can add &CUSTBODY_MY_FIELD=6000
to the URL.
Here's a sample code snippet:
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&CUSTBODY_MY_FIELD=6000>');
}
exports.myButton = myButton;
exports.pageInit = pageInit;
return exports;
});
In this example, CUSTBODY_MY_FIELD
is the ID of the custom field and 6000
is the value you want to filter by. Replace these with your actual field ID and value.
Please note that you might need to add the field as an available filter to the saved search for this to work.
******
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, 9:25 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865657926
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.854029596
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851469457
Celigo AI
09/11/2024, 9:25 AM