Can I run suitelet by adding a button in UE script...
# suitescript
b
Can I run suitelet by adding a button in UE script without client script? I have added a button using beforeLoad entry in UE
Copy code
var suiteletButton = form.addButton({
                  id: 'custpage_suitelet_button',
                  label: 'Open Suitelet',
                  functionName: 'window.open(' + suiteletURL + ')'
                });
And I defined suiteletURL above this code.
Copy code
let suiteletURL = url.resolveScript({
                    scriptId: 'customscript_script_id',
                    deploymentId: 'customdeploy_script_id',
                    params: {                        
                    },
                    returnExternalUrl: false
                });
I can see the button but clicking that button nothing happens. How can I make that button work?
w
It should work. But if you have attached a client script through the UE script as well, NS will add additional code around your “functionName” Right click and inspect the button to see what the actual onClick function is
b
your functionName is being used as a string passed to eval
the string you are passing it is not valid javascript, so you get an error, probably syntax related
w
”function(){ window.open()}”