0
votes

In Netsuite, i am generating a button using Suitelet Script Type. when i click it , it will take me from current Netsuite page to a 3rd party page .When i am in 3rd party page and click submit in 3rd party page , it will redirect me back to Netsuite page which will have new URL like below. How to capture the URL values in the Suitelet i created.

URL : https://system.netsuite.com/pages/customerlogin.jsp?code=U50YFx&state=xyz

I want to capture this url and get the value of "code" above. Can some one please tell how to achieve that .

1
Did you try reading params the same way as you would if redirected/opened internally? i.e could you try once with context.request.parameters? Note: context is the argument received to onRequest method of suitelet in SuiteScript 2.0. - Avi
i used searchParams function to resolve this issue - hem

1 Answers

1
votes

Im able resolve this by calling client script from the Suitelet . The redirect url will take me to the suitelet. And in client script i added below code :

var currentUrl=document.location.href;
    var url = new URL(currentUrl);
    var authCode = url.searchParams.get("code");