UI Page, redirect when page is loading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2016 06:47 AM
I have a UI Page. Before page loads, I need to make a redirect based on condition.
I tried something like this, but didn't work.
<g:evaluate jelly="true">
var v = new GlideRecord("myTable");
v.addQuery("sys_id",jvar_XXXX)
v.query();
v.next();
if(!v.field)
{
gs.sendRedirect("/redirect to anothe ui page");
}
</g:evaluate>
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2018 10:28 AM
Hi Brad,
How could we check if a ui/cms page is loading via mailscript?
Thanks
Divya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2016 07:20 AM
I don't know, i thought there is a standard way to do this using GlydeSystem and not to mess js with jelly code. I think i'll use js, because the redirect is required only if condition is true. In your example you have used v.next(), this mean if there is a record in the table, but in my case i need a redirect if a specific field is empty, not the current record.