Solved

PM calendar generation scheduled task

  • 24 March 2021
  • 3 replies
  • 301 views

Userlevel 6
Badge +17

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!

 

icon

Best answer by cjohnson 24 March 2021, 19:17

View original

This topic has been closed for comments

3 replies

Userlevel 6
Badge +15

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.

Userlevel 6
Badge +17

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.

 

 

Userlevel 6
Badge +17

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