Skip to main content
Solved

PM calendar generation scheduled task

  • March 24, 2021
  • 3 replies
  • 478 views

Forum|alt.badge.img+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!

 

Best answer by cjohnson

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

This topic has been closed for replies.

3 replies

dhlelk
Superhero
Forum|alt.badge.img+15
  • Superhero
  • March 24, 2021

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.


Forum|alt.badge.img+17
  • Author
  • Superhero (Customer)
  • March 24, 2021

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.

 

 


Forum|alt.badge.img+17
  • Author
  • Superhero (Customer)
  • Answer
  • March 24, 2021

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