Skip to main content

Hello all, 

I’m attempting to setup a scheduled task to generate calendar based PMs and I’m having an issue setting up a date range. I would like the task to generate PMs for the upcoming week, so as not to create numerous unnecessary Work Orders. 

When I tried to specify  a variable as I would in other fields, I received an error that I could not use that expression. My question is how to specify a rolling time period for generation? If you did not do this, would it not create numerous Work Orders, essentially for the entire Maintenance Plan?

Any help would be greatly appreciated!

 

Hi @cjohnson,

Could you try using the following?

Context_Substitution_Var_API.Get_Client_Value__('START_OF_NEXT_WEEK')
Context_Substitution_Var_API.Get_Client_Value__('END_OF_NEXT_WEEK')

Cheers !
Dhananjaya.


Hello @dhlelk I did attempt to use that and execute the Task. However, it resulted in an error message:

 

I am using the following Database Task, so I do not know if that would be causing the issue.

 

 


@dhlelk I was able to get this working using SYSDATE:

 

Adjusting the scheduled run of the job and using SYSDATE allowed me to add days 7 (one week) 14 (two weeks).

 

Thank you for getting me pointed in the right direction.