So this script is actually a little bit out there. We're using the ccx user agent to manage incoming and outgoing phonecalls. This allows us to automate tasks. When the user agent set up a new call for a rep it brings up the associated task. To give myself something to work with we've set it so that whenever the ccx user agent is used to pull a netsuite record (customer, task, etc) it does so using a get request that adds an additional parameter. The question then becomes, how do I use netsuite to read this additional parameter?
So far I've tried to use general javascripting in order to try and parse it out. I found and am using the following code:
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
However, when I call 'window.location.href' I get the following error from Netsuite TypeError: Cannot read property "href" from undefined
Anyone have any thoughts as to either how I can use Netsuite to get the passed parameter, or why calling window.location.href isn't valid/working?