FileMaker WebDirect: Alternatives to the "Open URL" Script Step
While FileMaker WebDirect supports the "Open URL" script step, when it is used, it always opens the URL in a new window. That's not always the desired effect.
Redirecting In the Same Tab
If you want to redirect the WebDirect user to an entirely new location, and do so in the current tab, then you can use the "top.location.href" method. With this approach, "top" forces a redirect of the tab itself - not just of the Web Viewer.
To use that code, you would create a layout and place a Web Viewer layout object on it. Setup the Web Viewer to use a Custom Web Address, and then configure it to use a Data URL (with "data:text/html," followed by the code above). Then, simply navigate the WebDirect user to the layout. They'll be redirected to the new URL.
However, note that their WebDirect session will remain open on the server, until the session times out. Also, if the user tries to go back to the WebDirect page, they will be required to reauthenticate. So use this approach with care.
Opening A URL In A New Tab
<title> WebDirect New Tab</title>
var newWindow = window.open('http://filemaker.com/');
In this example, we're opening a new tab using "window.open," and we've specified the URL for the new tab. The original WebDirect tab remains open. And again, to use this approach, you would follow the same steps that I listed above.