The CreatorCon Call for Content is officially open! Get started here.

UI Page, redirect when page is loading

whitewalker
Kilo Contributor

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>

6 REPLIES 6

Hi Brad,



How could we check if a ui/cms page is loading via mailscript?



Thanks


Divya


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.