247
Views
9
Comments
Solved
Delay before redirection to another screen
Question

Hello

I have specify a condition in one action and If the condition's result is true, then the user redirected to an X screen.

I want before the user redirection, to be displayed a message such as "in x seconds you will be redirect, please wait" and these seconds to be configurable.

I have set a javascript but this does not applied :(

any other idea?

2023-02-20 05-20-57
Nam Nguyen
Solution

Hi George M,


This is a traditional web app, everything is a server call, I think you should use the Sleep extension instead of JavaScript.

Cheers,
Nam





2024-12-02 12-15-17
Aravind EONE

Great!

2024-12-02 12-15-17
Aravind EONE

1. Create a client action and link it.

2. Add your message using message widget.

3. Add below javascript for redirection.

setTimeout(

        function(){

            window.location = "order.asp" 

        },

    5000);

5000 - in milli seconds. Which is equivalent to 5 seconds.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

If you would pay more attention to read the question, you would have seen this is about traditional een app, not reactive.

Regards,

Daniel

2024-12-02 12-15-17
Aravind EONE

Hi Daniel,

Regardless of reactive or traditional web, 

There is a flaw in javascript. Redirection code is missing in set timeout code.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

I was just pointing out that a client action is not available in TWA, and whether to use Javascript at all is also debatable knowing that this runs server side.

2024-12-02 12-15-17
Aravind EONE
2024-12-02 12-15-17
Aravind EONE

In your javascript, 

Instead of console log, add your screen URL to navigate.

2023-02-20 05-20-57
Nam Nguyen
Solution

Hi George M,


This is a traditional web app, everything is a server call, I think you should use the Sleep extension instead of JavaScript.

Cheers,
Nam





2024-12-02 12-15-17
Aravind EONE

Great!

2024-02-16 07-43-18
Amit Verma

Hi George M,

Please refer below code for redirect from one screen to another screen

"setTimeout(function(){ location='/RedirectDemo/Screen2.aspx'; }, 5000);"

RedirectDemo : Module Name

Screen Name : Screen2

Hope this will help you :)

Thanks,

AV


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.