I have created a process in which entry criteria is that if case is in 'required Information' state it enters in the process and schedule a reminder for 30 days after. Now I am updating this process to send the reminder after 60 days.
Problem is, when I set it for 60 days I want to check if there is any 30 days reminder already scheduled for this same case record. I can see that in Time Based Workflow but how can I check in process that if there is already a reminder set than do not set another reminder for 30 days or update the existing one from 30 days to 60 days
Thanks in Advance
Related
I have an AppleScript that runs on loop every two hours to modify a calendar B based on updates from another calendar A.
The script uses the on idle command below to wait 2 hours every loop. What happens if the computer stays idle for 1.5 hours then goes to sleep for 10 hours? Will there be 0.5 hours left when it wakes up? Any other scenarios?
on idle
my_code()
return (120 * minutes)
end idle
The script truly only needs to run if there is an update to calendar A, which is a shared iCloud calendar and can get updates from multiple people. The two hour loop is what I could figure out so far but I feel it is not efficient. Any more robust suggestions? Is there a way I can trigger the script to run only when it detects an update in calendar A? Or, along the same line of thought, is there a way to get the last timestamp the calendar was updated?
Thanks
I can't test following. Not sure it is the best way to solve your problem. Try yourself:
property oldStampDates : {}
on run
tell application "Calendar" to tell calendar "Test Calendar" to set oldStampDates to get stamp date of events
end run
on idle
--> Script retrieves last modified date and time of indicated calendar events.
tell application "Calendar" to tell calendar "Test Calendar" to set newStampDates to get stamp date of events
if newStampDates is not oldStampDates then display notification "The changes was detected"
set oldStampDates to newStampDates
return 30 -- seconds, default setting
end idle
NOTE: 1) you can put instead of display notification call to your handler my_code(), 2) you can put instead of 30 seconds other value, for example, return 10 (checking every 10 seconds).
I want to execute a Job in CRON for every 14 days from a specific date and timezone.
As an e.g. from JUNE 24TH every 14 days in CST time zone.
Run job every fortnight
The easy way
The easiest way to do this is simply to create the task to run every 14 days from when you want it to first run like:
CREATE TASK mytask_fortnightly
WAREHOUSE = general
SCHEDULE = '20160 MINUTE'
AS
SELECT 'Hello world'
How it works
As there are 60 minutes in an hour, 24 hours in a day and 14 days in a fortnight, ergo that's 20,160 minutes.
Caveat
The above solution does not run the task every fortnight from a given date/time, but rather every fortnight from when the task is created.
Even though this is the simplest method, it does require you to be nominally present to create the task at the exact desired next scheduled time.
As a workaround however, you can create a one-shot task to do that for you the very first time at the exact correct date/time. This means you don't have to remember to be awake / alert / present to do it manually yourself, and you can clean up the creation task afterwards.
The harder way.
Other solutions will require you to create a task which gets run every Thursday (since 2021-06-24 is/was a Thursday, each subsequent Thursday will either be the off-week, or the fortnight week)
e.g. SCHEDULE = 'USING CRON 0 0 * * THU'
Then you will add specific logic to it to determine which one the correct fortnight is.
Using this method will also incur execution cost for the off-week as well to determine if it's the correct week.
Javascript SP
In javascript you can determine if it's the correct week or not by subtracting the start date from the current date and if it's not a mutiple of 14 days, use this as a conditional to short circuit the SP.
const deltaMs = (new Date) - (new Date('2021-06-24'));
const deltaDays = ~~(deltaMs / 86400000);
const run = deltaDays % 14 === 0;
if (!run) return;
// ... continue to do what you want.
SQL
You can also check if it's a fortnight using the following SQL condition in a WHERE clause, or IFF / CASE functions.
DATEDIFF('day', '2021-06-24', CURRENT_DATE) % 14 = 0
Every two mins it should get a trigger for 3 hours.
Run the logic app every day at 9 am?
The above logic app triggers and runs for every 2 min.
how to set timing(3hrs) and for each day(every day) at 9 am?
eg: 10 Sep 2020 at 9 am to 12 should run, every 2 min trigger and finishs the task.
You should change Frequency From Minute to Day, then cilk Add new parameter to add At these hours and At these minutes.
Because At these minutes cannot use cron expressions, you can only follow the format of 0,2,4,6.....58 to make it execute every two minutes.
If you have any other questions, please let me know.
I need to generate a report that shows activity on all accounts, were the last activity is greater than 7 days ago, thus not showing accounts that have had activity in the past 7 days.
I know this can be hard set when building the report, but I need this to update for the current day each time it is run. I don't wont to have to edit report everyday.
Wouldn't it be where DateField > LAST 7 DAYS since report support relative days such as LAST WEEK or LAST FY or YESTERDAY etc
I'll try to explain my problem:
I have one model Attorney with have many rows.
Every attorney have a date to expire in a date coloumn. Ex: 15/09/2013
I need to check, every day, if some attorney will expire in 30 days.
In other words, I need to check, every day, the date of every attorney registered and if the date of expire is less than 30 days, and grab the id of the attorney in this situation and execute an action.
I have nothing. How I do this?
You will probably need to use a cron job to execute these task every day.
To check if a record will expire in 30 days, you could use php strtotime to calc the final date. Then, you should compare if the expire date is lower or equals:
date('Y-m-d', strtotime( date('Y-m-d') . ' +30 day' ));
try the cron job for linux ;or schedule for windows . they will check the date field and do an action depend on your conditions , here is a link for example :
http://blog.nexcess.net/2013/05/09/cron-job-for-the-last-day-of-the-month/