2

I have created a suitelet script. I want to run it in new window. For that i have created a custom button on sales order and passed a 2.0 client script function on button(to redirect to the suitelet). Currently the suitelet gets opened in same window on click of button.

The Client Script : 
/***@NApiVersion 2.0*@NScriptType ClientScript*/
define(['N/url'], function(url){
var pageInit = function(context) { }
var closebutton = function(context) {
try
    {
window.location= url.resolveScript({
        scriptId: 'customscript337',
        deploymentId: 'customdeploy_sdm',
        returnExternalUrl: false
   });
        return false;
    }
catch(err) {
        log.debug({ title: 'ERROR', details: err });
    }
}
return {
pageInit : pageInit,
        closebutton : closebutton
}`pageInit : pageInit,
        closebutton : closebutton
}  
});`

I just want it to open in new browser window(not new tab).closebutton is the function i passed to the custom button. Need help

Saurabh More
  • 383
  • 4
  • 25

1 Answers1

1

SuiteScript is just a library on top of JavaScript; thus, in a Client Script, you can use any normal JavaScript methods for opening a new window, e.g. https://developer.mozilla.org/en-US/docs/Web/API/Window/open

erictgrubaugh
  • 8,519
  • 1
  • 20
  • 28