Skip to main content
Solved

PM calendar generation scheduled task


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. 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

3 replies

dhlelk
Superhero
Forum|alt.badge.img+15
  • Superhero
  • 200 replies
  • 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)
  • 224 replies
  • 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)
  • 224 replies
  • 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. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings