I have a Suitelet that has a link to a CS script (...
# suitescript
j
I have a Suitelet that has a link to a CS script (form.clientScriptFileId = 4516103;) to take care of button functions on the suitelet. Below is a truncated version of the CS Script. I am getting the following errors in the console: 'Invalid define call; unable to load module: /SuiteScripts/XYZ_CS_ButtonFunctions: Module does not exist: N/redirect.js' and 'Uncaught Error: Load timeout for modules: N/redirect'.
Copy code
/**
 *@NApiVersion 2.1
 *@NScriptType ClientScript
 */
define(['N/url', 'N/record', 'N/redirect'], function(url, record, redirect) {

    function pageInit() {

    }

    function returnHome() {
        redirect.toTaskLink({
            id: 'CARD_-29'
        });
    }

    return {
        pageInit: pageInit,
        returnHome: returnHome
    }
});
m
The docs for
N/redirect
show that it's only supported in specific server-side scripts. It doesn't appear that either portlet or client scripts are supported. https://system.na0.netsuite.com/app/help/helpcenter.nl?fid=section_4424286105.html
In a client script, you could use the
N/url
module to get the URL of your destination, then use Javascript's standard
window.open()
to send the user to that URL.
j
Ah, that's it. Thank you!
139 Views