Message - Improvement
Heres a thing...
As these days I work mainly from home - I have a reminder that if appropriate! sends and email to my team at the office when I log into Ninox. The script is set in the global script area and works reasonably okay.... I have it do an email because as yet global scripts won't cause a pop up message to be triggered and certainly it won't pop one up to another user.
So the idea behind the script is once I have logged into the database app, it goes and looks for any occurrence of a jobs promisedby date that is is due 2 days from today - if it finds one it sends the email. Which job it finds does not matter as long as it due in 2 days - the purpose is to alert my team that some promised jobs are due and we have a daybook view that is filtered to show all promised jobs..... and my team can ensure with the suppliers that the goods/production is on target for the due date. ..... all good so far and bobs your mothers brother etc ....
The extra lines re weekday testing simply checks to cover testing over a weekend. ie Thursday will not check for Saturday but will look for the following Monday instead etc...
This is the script (as as said works fine!)
openTable("JobDockets", "Live Jobs");
let d := if weekday(today()) = 3 then today() + 4
if weekday(today()) = 4 then today() + 4 else today() + 2 end
if cnt(select JobDockets where DispatchBy = d and Promised = true) > 0 then
subject: "Promised jobs are soon due for dispatch",
html: "Some promised jobs are due to be dispatched, Please check the promised daybook for any jobs due to be dispatched and confirm with works/suppliers that all is on target"
So whats the problem.?
Nothing major, but as I hop in and out of several databases and also have a database for doing testing and development. Then on the days that the trigger will fire, it fires every time I go back in after previously exiting earlier. So that is not great and my staff think I'm constantly reminding them to check the daybook. Some days it can fire maybe 8-10 times.
So I can live with my team telling me off but ... Can anyone suggest better/smarter way I could achieve the same task.
As said I 'm at home and my team are some 15 miles away....
Ps I have tried building a table that acts as an internal email which was populated by me going down the jobs and setting a flag to add it to a daybook as a reminder but this failed on the days I am tied up with other duties or even off site. Hence the above script was born and frankly does not require anyone to remember to tick a chase flag