If you want to redirect a user that makes a GET ca...
# suitescript
w
If you want to redirect a user that makes a GET call on a suitelet, what would you do? return a small page with a script that sets the url? or is there a better method?
e
Use location.href to redirect to the URL using a client script referenced by the Suitelet.
w
This is what suiteanswers suggest:
Copy code
context.response.write({
    output: '<!DOCTYPE html><html><head><title>HTML Meta Tag</title><meta http-equiv = "refresh" content = "1; url = '+shareLinkUrl+' " /></head> <body><p>Redirecting to another URL</p></body></html>'
})
A bit hack-y, but to add a separate client script and reference it sounds overcomplicated. I'd like to do
context.response.sendRedirect(url)
k
You can’t use just url in sendRedirect but you can redirect to other things. If not use the redirect module and redirect.redirect for specifying a url.
👍 1
w
Cool @karlenigma! I'll try that
💯