I am trying to write a suitelet. On a demonstration form with a couple of fields, I created a client script for execution on field change.
1. function demoload(namex,type)
2. {
3.
4. var url = nlapiResolveURL('SUITELET','customscriptdemosimpleform','customdeploydemosimpleform',true);
5. alert( url);
6. var a = new Array();
7. a['User-Agent-x'] = 'SuiteScript-Call';
8. var response = nlapiRequestURL( url, null, a, null);
9. alert('Check it');
10. return true;
11. }
it calls the following
1.
function
demosimpleform(request, response)
#
{
#
var
# html = '<html><body><h1>Hello World</h1></body></html>';
response
# .write(html);
response
# .setHeader('Custom-Header-Demo', 'Demo');
nlapiLogExecution
# ('DEBUG', 'form finished', 'written');
# }
The code executes from the alert display and the execution log of demosimpleform but nothing appears on the screen. This code is copied from the Suitelet examples.
Can someone tell me why I do not see 'Hello world' on the screen, and how I could make this screen a new window.?
Thank you for your help in advance.