ui action redirecting it to previous page

tghadage124
Tera Contributor
function onredirect(){
    g_form.setMandatory('u_close_code',true);
    g_form.setMandatory('u_percentage_complete',true);
    g_form.setMandatory('u_is_this_request_completed',true);
    action.setRedirectURL(current);
} 
 
here I have set it to current but still its taking me to the previous page where I need to stay it on the same page. 
Please guide !!
8 REPLIES 8

Hi @tghadage124 ,

 

Tried in my PDI

it works seamlessly:

 

1)Also when your setting any fields to Madatory it will not back to previous page its form validation and you don't have set action.setRedirectURL(current);

2)And also "action.setRedirectURL(current)" its Server side method 

 

However it works.

 

UI Action:

HemanthM1_0-1724758233796.png

 

On the incident form:

I have used close code fied:

 

HemanthM1_1-1724758304490.png

 

 

Screenshot (344).pngScreenshot (345).png

still the same.

Hey @tghadage124 ,

 

Your fucntion call should be in onclick field not in the condition

 

if its not on the form bring it on

HemanthM1_0-1724777445529.png

 

 

 

 

Ravi Gaurav
Giga Sage

Hello @tghadage124 

This works in server side script of UI Action.

Please move this to server side script and validate.

 

 

 

RaviGaurav_0-1724766358821.png