Topic: Reminder alerts

Hi All,


I'm trying to build a simple task/reminder utility for personal use. Using the Form1 for date and time display in order to occupy minimal screen space. Unfortunately, I couldn't get alerts (text and sound) working?


Please see the attached project:

Post's attachments

Attachment icon SimpleTasksSML2.zip 144.19 kb, 30 downloads since 2024-04-07 

Adam
God... please help me become the person my dog thinks I am.

2 (edited by sparrow 2024-04-08 09:26:01)

Re: Reminder alerts

Hi Adam


Your "datetime" field in the "Remainder" table is always NULL and I did not find where you should set it. Check the query condition in the procedure OnTimer;:

duedate Is Not Null and datetime Is Not Null and Date(duedate) <= strftime('%Y-%m-%d', 'now','localtime')
...
and strftime('%H:%M', Time(datetime))

You can simply use Date(''now'',''localtime'') instead of strftime(''%Y-%m-%d'', ''now'',''localtime'')

Re: Reminder alerts

Hi Adam,
I use a much simpler version of what you have built but instead of using a toggle to 'stay on top', mine always 'stays on top' but I then hide it off to the side of the screen when it's not in use.
In the attached example, click on the date to hide Form1 and to bring it back, move the mouse to the left of the screen to where it's been docked.
Maybe it's something you might find useful.
Regards,
Derek.

Post's attachments

Attachment icon SimpleTasksSML3.zip 478.64 kb, 34 downloads since 2024-04-08 

4 (edited by AD1408 2024-04-08 12:22:54)

Re: Reminder alerts

Hi Sparrow,
Thank you for the reply. I still couldn't get alerts working tho... Could you please apply to the project posted, if possible...


Hi Derek,
Thank you for the useful approach... You can always add new features / change existing ones If and when you have the time.

Adam
God... please help me become the person my dog thinks I am.

Re: Reminder alerts

  Rec_Id := SQLExecute('SELECT id FROM reminder WHERE (PlaySound = 1 or MsgPopup = 1) and '
         + '((duedate Is Not Null and Date(duedate) < strftime(''%Y-%m-%d'', ''now'',''localtime'')) or '
         + '(Date(duedate) = strftime(''%Y-%m-%d'', ''now'',''localtime'')))' );

I removed the check for the "datetime" column from the request

Re: Reminder alerts

Hi Sparrow,
I truly appreciate your kind effort of help.
Currently, I get sound and text pop up alert at the same time (only play sound checkbox checked) just after saving the record, ignoring the alert time set.

Adam
God... please help me become the person my dog thinks I am.

Re: Reminder alerts

You should decide what criteria to use to check records in the OnTimer procedure.
You have the following fields StartDate, StartTime, DueDate, DueTime, PlaySound, MsgPopup, taskCompleted. Which fields should be included in the verification and under what conditions. Moreover, checking for messages and sound should be separated separately.

Re: Reminder alerts

Hi Sparrow,
Sound and text alerts should be triggered on task/reminder specified due date and due time. It'd need both due date and due time.
Text only alerts useful when sound not needed, However, text alert also will be useful with sound alert, in order to show what the sound alert is about.

Adam
God... please help me become the person my dog thinks I am.

Re: Reminder alerts

Hi Adam


I don't understand what algorithm you are trying to achieve.
Why then StartDate, StartTime? Why are the signs of message or sound output automatically removed immediately after one trigger? No more reminders needed? Maybe I haven't studied the project well enough?


I'll shorten my question.
You have StartDate, StartTime, DueDate, DueTime. For which Start or Due event should the reminder be triggered?
Right now you are checking (DueDate <= current date) and (message OR sound are 1).
The second part of the test (message OR sound equals 1) is already incorrect. It causes both message output and audio output to be executed even if only one of them is enabled.
Find answers to the questions for yourself and adjust the condition check.

Re: Reminder alerts

Hi Sparrow,
Perhaps there is a misunderstanding originating from my end.
I was trying to have text and sound alerts for a reminder/task.
Please ignore what I have done and do it your way, that's off course if you have the time.

Adam
God... please help me become the person my dog thinks I am.