Scheduled job to run conditionally
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 11:16 AM
I have a scheduled job that is Daily, Weekly, Monthly, Quarterly, Semi-Annually, Annual
I have added a field the scheduled job form "Asset Tag" & "Maintenance Plans"
I want to make use of the conditional script option but would like to know how to run the script based on those fields.
IF the asset tags and maintenance plans match do not run.
EX: Daily weekly and annually have the same Maintenace plan and asset tags I want them to continue to run but when the daily/weekly run but the annual triggers if it is on the same day:
daily & annual only run the annual for that day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:25 PM
Hi @Joshua Comeau ,
You can just a conditional at the start of your code that if that sentence is true continue with the code and else don't do anything
if(current.u_asset_tag == current.u_maintenance_plans){
//Your code that you want to execute go here
//Code...
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:28 PM
I am unsure on the code to be honest, I would be using conditional script box not run this script,
I need a script on the condition if the schedule jobs (1 is weekly and another 1 annual)
they share the same asset tag and maintenance plan only run the annual not the weekly for that time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:37 PM
What type of schedule job are you using?
Specify the table if you can [sysauto,sysauto_script, etc..]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:39 PM - edited 07-23-2024 12:39 PM
sysauto_script