I want to trigger a task on 15th Oct of every year. For this I am using a wait shape with Reference date/time property.
What would be the function to set the Date property fixed date (15th Oct) and checks the same date every year?
ex. if 15th Oct 2023 is already triggered then next trigger would be on 15th Oct 2024.
@SonalM99 try below syntax, should work.
“10/15/” + FormatDateTime(CurrentDateTime(),“yyyy”,“”,“”)
if not working, try to convert in datetimeformat once yu get the date from above syntax.
@SonalM99 so any cases before 15 October 2023, should have the referenced property date as 15 Oct 2023. Any cases after 15 October 2023, should have 15 October 2024. Is this the requirement?
@DineshKumarD9112 Yes Dinesh. It should take current year of 15th Oct, it should trigger every year on 15/10
@Hitesh Jain Hi Hitesh, thanks for the function but this wont work in my case. Lets say user finished the task on 18th Oct of 2024, then this function will set again 15th Oct of 2024 as per the function coz we have SLA of 3 days to finish this task. This function will always set the current year. I need to append the date for next year i.e next execution should be on 15th Oct 2025.
In that case you can add +1 in the year as soon as you finish the task.
you can queue it based on your requirement by setting the date for a dedicated queue.
when the current year execution is done then again re-queue it for the next year.
or Job-scheduler is another option.