For my online customer (lead) form, I'm trying to do a dynamic redirection to two different "thank you" pages, based on user input (a yes/no select).
There's a user event script deployed on the lead record which does some processing, which works fine. I used nlapiSetRedirectURL to redirect the form with a URL parameter (the yes/no mentioned above) to a suitelet which does the page redirection for me. I tried it both before and after submit, received no errors, but was not able to override the redirect URL set in the workflow tab of my online customer form.
redirect function in user event script:
var userParm = nlapiGetFieldText("custentity82"); // set url parameter "TM" if (userParm == "Yes") {var urlParm = "&TM=T";} else if (userParm == "No") {var urlParm = "";} // redirect to suitelet with url parameter nlapiSetRedirectURL("EXTERNAL", "https://system.netsuite.com/app/site/hosting/scriptlet.nl?script=60&deploy=1"+urlParm , null, null); nlapiLogExecution("DEBUG", "debug", "URL parameter: " + tmParm);The URL parameter does show correctly in the execution log, so the script is deployed correctly.suitelet that does redirection:function redirect(request, response) { var params = request.getAllParameters(); var userParm = params["TM"]; if (userParm == "T") {response.write("&lt;script&gt;window.location = 'http://www.foo.bar/thankyou1.html'</script>");} else {response.write("&lt;script&gt;window.location = 'http://www.foo.bar/thankyou2.html'</script>");} } The above suitelet works fine if I type in its address with the URL parameter manually.Any ideas why nlapiSetRedirectURL is not working for me? Does it simply not work for online customer forms? I'd expect to get at least an error message -- now it's just silently failing to do anything.