Hi all,
After certain period of inactivity, the form cannot be submitted and the data entered are not saved. So I want to display a warning message like "The data you have entered is not saved to the system due to timeout" after form timeout minutes. How can I achieve this? Any idea? Thanks in advance.
Brinda Sateesh
Discussion posts and replies are publicly visible
Could you use the refresh variable function? Here's what I'm thinking: you could load the page and capture the time the page was loaded using now(). Then, add a refresh variable that will update based on a timer. If this variable updates, the interface can then display a different message that the task has timed out. Here's an example:
a!localVariables( local!pageLoad: now(), local!pageCurrentTime: a!refreshVariable( value: now(), refreshInterval: 1 ), local!value, if( local!pageLoad + 1 / (24*60) > local!pageCurrentTime, /*Checks to see if the time has elapsed */ a!textField( label: "Enter Data Here", value: local!value, saveInto: local!value ), a!richTextDisplayField( value: "The form has timed out!" ) ) )
Further, it seems that we could use this technique to display a warning banner when there are only a few minutes left to complete a form, and perhaps a standard practice for forms with expiration timers should be to display a periodically-refreshed banner somewhere prominent to serve as a notice that the form will time-out at "X" time.
But the page including its local!varibles will stop updating once it has timed out?
I'm not sure that's true, but in any case you would want to make the on-form "soft" timeout at least a minute or two shorter than the task timeout time limit, and then this won't be an issue at all.
Yeah agreed - having a little buffer would be the best way to go. Plus, in the timeout version of the form you could even give a "close" button or something that would let them still submit the form and compelte the task. Then it's less important for the form exception to occur at the same time (you could even wait 30-60 min or something to be safe).