Avoiding error on delayed action

Hi,

I have a requirement to trigger an API call only if the agent has answered an incoming callback.

If the agent declined or times out from answering the callback, the timer continues to run in the browser and a Scripter error is triggered when the API would normally run. I suspect this is because interaction related variables are no longer available.

Is there any way to avoid the API from triggering when the agent has not answered the callback, to stop the error from appearing?

I thought of using Scripter.Interaction State to evaluate all the different state types, but I'm not sure if this will still be available when the agent is no longer being offered the callback.

Edit: I tested adding a condition of Scripter.Interaction State = "Connected" or "Connecting" and the Scripter error still appears if the agent has declined / timed out before the timer is about to run.

Edit 2: Found the solution, there is a Try / On Error block that can be added that stops the error pop up from appearing.

Edit 3: The Try / On Error block was giving me false positives in my initial testing and does not stop the error pop up from appearing. The errors are always triggered because scripter is trying to read a disposed property (presumably Scripter.Interaction State).

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.