I figured as long as I was writing a note to support I'd try picking the forum's brains as well. Basically I'm trying to call nlapiRequestURL() to hit a CGI script on the server. Because there's some kind of character limit on how long that string can be we're opting to try and pass the data as headers. We know that this is at least possible as we've done it once before in another script. So my question becomes, is there some reason why nlapiResolveURL would work in a library script but NOT in a User Event onSubmit function?
I do manage to get a line of debug (the first nlapiLogExecution call below) from directly before I attempt to fetch the URL, but I get an unexpected error on the line when I do.
This is the section of code that's breaking:
function beforeSubmit() {
var headers = new Array();
headers['X-Id'] = id;
headers['X-RepId'] = userId;
headers['X-Type'] = 'remote';
nlapiLogExecution('DEBUG', 'tracking - firing', 'fetching url with userId : id ' + userId + ' : ' + id);
var response = nlapiRequestURL(url, null, headers, null);
var recipient = response.getBody();
nlapiLogExecution('DEBUG', 'tracking - now active', 'got through url with response id ' + recipient);