98
Views
14
Comments
Solved
Timer
Question

Can anyone help me

I tried to make a reminder every 4 pm. I found that you can make that happen with the timer tools. I've tried it but I'm getting some errors. Is there something wrong with my implementation? Please help

This is the timer:

This is the action that will run when the timer run:

And on the uI flow I catch it :

Here's the error I got from service center:


Can someone help me on this please, I just want to make a daily reminder on 4pm. Is this the best we to do it? or is there another easier way to make it happen?


2020-09-21 08-42-47
Vincent Koning
Solution


If you want a client popup (as you showed in the screenshot) I would use the OnTimeout widget of the Timing Events component (https://www.outsystems.com/forge/component-overview/8422/timing-events).

Add this timer to your Layout and calculate the timeout value with something like this: 

TimeoutValue = DiffSeconds(CurrDateTime(), BuildDateTime(CurrDate(), NewTime(16,0,0))) * 1000

Use TimeoutValue as input for the OnTimeout block. The OnTimeout will now wait your supplied amount of milliseconds and then fire the associated event. Add the code you need to display whatever you want in the event action and you are good to go.

Hope this helps.

Greetings,

Vincent

UserImage.jpg
vikas sharma
Champion

Hi,

In above screenshot in timer's action there is no logic and end node is exception node. So It will always logs the exception. You should write some logic in this and for any specific condition like validation failure you need to raise the exception.

regards

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi,

Timers do not run in the context of a client application. So you cannot handle an exception in an UI module that is raised from a timer. Timers run server-side in its own module context.

Best

Stefan

UserImage.jpg
raven ransford

So is there other way to make a daily reminder?

2021-10-09 07-57-44
Stefan Weber
 
MVP

Depends on how you want to remind. You can send an email from your timer server action or you can use Server Sent Events (SSE) or Push Notifications to interact with a frontend. For SSE and Push Notfications you find many components on the Forge. If you have an Azure Tenant you may want to give Azure Web PubSub a try. A component for this service can be found here https://www.outsystems.com/forge/component-overview/13258/azure-web-pubsub (Iam the creator and maintainer of this component)

2022-08-03 04-32-50
Ravi Punjwani

Hi Raven,

The empty logic in the Timer function ending with exception would do just the same. Raise an exception.

Can you suggest what are you trying to do here?

At 4pm, what are you expecting out of the system? Any email? Notification? Text? Process execution? etc. You must add some logic to achieve anything.

On another note regarding your 3rd picture on the post, a timer runs in an independent thread. Your user interface will not be able to catch any exceptions happening in the Timers.

So you must decide on how the system should work. User Interface catches exceptions happening in the current session only, based on user's actions for processing something, like OnClick event etc.

UserImage.jpg
raven ransford

I just want to make a reminder, some message to inform the user. How can I achieve this? 

2022-08-03 04-32-50
Ravi Punjwani

It is not very difficult, but you need to model your app properly.

Have you thought about:

  • What should happen if the user is not logged in at 4pm?
  • How will you know if they seen the message or missed it while the screen was open but user wasn't actively working on their browser? Or do you even care if they see or didn't see?
  • Any many more scenarios to cover for such alerts system.
2021-01-19 14-07-32
Tom Zhao

Hi 

What kind of reminder are you talking about?  I suppose you can use timer send reminder mail.

Also what type of application are you building?


Regards,

UserImage.jpg
raven ransford

I'm building an app to help my company approve expenses, and at the end of the day they need to do some sort of checking. So i need this reminder in case they forget to check. I want it to make a notification just like this:

The notification will pop when the user havent done any checking by 4 pm. The reminder will come every 4 pm. 

2022-08-03 04-32-50
Ravi Punjwani

If this is coming official from your company, an email is the best way to notify all the relevant employees.

I would rather ask employees to set an alarm at 4pm on their phones/devices, or schedule a meeting reminder like usually many companies do for weekly or monthly timesheet reminders. On screen reminders with no tracking are too easy to go unnoticed.

If employees are supposed to do their job around 4pm there shouldn't be so complex method of informing them. Try something simpler, although you can achieve it in some or the other way using Outsystems too.

UserImage.jpg
vikas sharma
Champion

Hi,

Basically you can't show this kind of notification using timers because as mentioned already timers don't run in UI thread. Instead you should check some possibility with web push notification/browser notification. Here it the link of one forge component : https://www.outsystems.com/forge/component-overview/13333/web-push

regards

2020-09-21 08-42-47
Vincent Koning
Solution


If you want a client popup (as you showed in the screenshot) I would use the OnTimeout widget of the Timing Events component (https://www.outsystems.com/forge/component-overview/8422/timing-events).

Add this timer to your Layout and calculate the timeout value with something like this: 

TimeoutValue = DiffSeconds(CurrDateTime(), BuildDateTime(CurrDate(), NewTime(16,0,0))) * 1000

Use TimeoutValue as input for the OnTimeout block. The OnTimeout will now wait your supplied amount of milliseconds and then fire the associated event. Add the code you need to display whatever you want in the event action and you are good to go.

Hope this helps.

Greetings,

Vincent

UserImage.jpg
raven ransford

THANKYOUU SO MUCCHHHH. THIS WORKS GREAT !!!

2020-09-21 08-42-47
Vincent Koning


Happy to help. Don't forget to mark the post as answer if it helped you. 

Greetings,

Vincent

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