Scheduled job to run conditionally

Joshua Comeau
Kilo Sage

I have a scheduled job that is Daily, Weekly, Monthly, Quarterly, Semi-Annually, Annual

 

JoshuaComeau_0-1721758338008.png

 

I have added a field the scheduled job form "Asset Tag" & "Maintenance Plans"

JoshuaComeau_1-1721758418179.png

 

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.

 

 

5 REPLIES 5

Marco0o1
Tera Sage

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...
}

Marco0o1_0-1721762716753.png

 

 

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.

What type of schedule job are you using? 

Specify the table if you can [sysauto,sysauto_script, etc..]

 

sysauto_script