Adding delay before page navigation

We are building a CRM with integration to our PBX.   When a call comes in I have a toast that pops up giving the agent a visual notification that something is happening.   (the toast is set to auto close after a couple seconds)


When the call is answered the CRM auto navigates to the call screen, and since the majority our our agents are set to auto-answer the call notification toast barely flashes on the screen before we navigate them away.   I'm trying to add a 2 second pause in code execution when the toast is displayed, to keep this from occurring.    I've tried adding a Javascript event with a setTimeout prior to the call answering logic but it seems to kick that off but then not wait for the timeout prior to moving on to the call answer step.


Any suggestions on how to slow things down a bit?

Solution

Josh Herron wrote:

We are building a CRM with integration to our PBX.   When a call comes in I have a toast that pops up giving the agent a visual notification that something is happening.   (the toast is set to auto close after a couple seconds)


When the call is answered the CRM auto navigates to the call screen, and since the majority our our agents are set to auto-answer the call notification toast barely flashes on the screen before we navigate them away.   I'm trying to add a 2 second pause in code execution when the toast is displayed, to keep this from occurring.    I've tried adding a Javascript event with a setTimeout prior to the call answering logic but it seems to kick that off but then not wait for the timeout prior to moving on to the call answer step.


Any suggestions on how to slow things down a bit?

Hi Josh,


See the example in the attachment.

You can create a action only with the RunJS with the SetTimeout function calling FakeUpdateNotify.

In your screen, put de fakeupdatenofity widget calling the another screen action with your code.


I don't know if that's what you want.


Solution

Pedro Costa wrote:

Josh Herron wrote:

We are building a CRM with integration to our PBX.   When a call comes in I have a toast that pops up giving the agent a visual notification that something is happening.   (the toast is set to auto close after a couple seconds)


When the call is answered the CRM auto navigates to the call screen, and since the majority our our agents are set to auto-answer the call notification toast barely flashes on the screen before we navigate them away.   I'm trying to add a 2 second pause in code execution when the toast is displayed, to keep this from occurring.    I've tried adding a Javascript event with a setTimeout prior to the call answering logic but it seems to kick that off but then not wait for the timeout prior to moving on to the call answer step.


Any suggestions on how to slow things down a bit?

Hi Josh,


See the example in the attachment.

You can create a action only with the RunJS with the SetTimeout function calling FakeUpdateNotify.

In your screen, put de fakeupdatenofity widget calling the another screen action with your code.


I don't know if that's what you want.

Thanks, this is a pretty slick solution.   I assume I can just swap notifying the web block with a click of an invisible button correct?  Or is the OSNotifyWidget the key here?   

Thanks,

The OSNotifyWidget is used to call a screen action, but, you can replace the OSNotifyWidget for a JsClick of an insibile button, the result is same.