- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 07:09 AM
Hey,
So I created a module and set the link type to "Script (from Arguments:)" When I click the module, it does what it's suppose to and then directs to the background script page. Is there a way for me to redirect it to another page, like the homepage or a table page? Thank you in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:30 AM
Have you thought about using a UI page? It would be pretty simple to embed your server code in a <g:evaluate></g:evaluate> and then redirect from there. Your module would use Arguments (from URL) to call the UI page.
my_ui_page.do
I've done this before to create records and then take them to the parent record that has just been created.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:15 AM
Hi Kenny,
Not at this point. I took a look at all the other modules that have the same type and none of them indicate any interactive usage. They all output using gs.print(), gs.log(), etc. which is how I figured out it was using the background script processor.
gs.setRedirect() basically sets an HTML redirect in the header tag, but since the stuff in the script field is processed in the background, HTML headers are meaningless.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:16 AM
Can you explain what the underlying requirement is? I feel we're focused on a specific technical solution and not on the use case. That's always a risky proposition. (And yes, I'm guilty of doing that too.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:20 AM
Basically, users should be able to click on a module and that, in turn, runs the script and then redirects to the home page.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:30 AM
Have you thought about using a UI page? It would be pretty simple to embed your server code in a <g:evaluate></g:evaluate> and then redirect from there. Your module would use Arguments (from URL) to call the UI page.
my_ui_page.do
I've done this before to create records and then take them to the parent record that has just been created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 08:35 AM
Ahh, thank you so much for the help. I'll look into that.