简体   繁体   中英

Netsuite SuiteScript how to get value from the redirected url

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 .

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM