Solved

Scheduled Database Task Parameter Issue

  • 27 February 2023
  • 5 replies
  • 230 views

Userlevel 2
Badge +6

Hello,

I’m not sure if this should be posted in the assets forum for the PM functionality or this forum for database task schedule functionality. We are attempting to create a new database task schedule to run the function Pm_Action_Calendar_Plan_API.Extend_Plan. This function extends the system parameter PM Plan Horizon. Our plan is to keep this value set 5 years out and the hope is to run this at the beginning of each year to automatically extend the plan horizon by another year. Otherwise it could easily be forgotten if it has to be run manually once a year. 

There’s only one parameter for this function called NEW_YEAR_ and it should be a YYYY number. I’ve tried multiple setups to set this to a value 5 years from this year, but nothing seems to be working properly. The closest I’ve gotten is using #NUMBER_OF_THIS_YEAR#+5 but this just sets the argument to quite literally 2023+5.

It seems odd that this parameter won’t sum the two values together. We have other PM calendar generation database tasks scheduled with sysdate+X setups that work fine. For example, we have one set up like this:

START_DATE_: sysdate

STOP_DATE_: sysdate+22

and the arguments used when it ran this morning were 

 START_DATE_2023-02-27-02.00.56

STOP_DATE_2023-03-21-02.00.56

Is there a different way to get this 5 year out value? Or is there a reason the summing doesn’t work for the Extend_Plan function but is working fine for the other calendar generation setups?

We are running Apps 10 update 13 IEE.

icon

Best answer by Tomas Ruderfelt 3 March 2023, 19:02

View original

5 replies

Userlevel 7

Can you try something like extract(year from sysdate)+5? 

Userlevel 2
Badge +6

Can you try something like extract(year from sysdate)+5? 

Here’s a screenshot of that setup:

But it seems to pass the entire thing as a string. The argument that shows in the background job is 

NEW_YEAR_extract(year from sysdate)+5

Userlevel 2
Badge +6

@JerryB Do you have any experience with scheduling this PM plan horizon job?

Userlevel 7
Badge +19

Unfortunately, it is only parameters of datatype DATE where you can enter calculations, and only if you use the text sysdate in it. new_year_ is not a date so you will always get exactly what you type in to that method.

 

The only way is then to schedule it to run for this year (2023) with value 2028.

Then create another schedule next year with parameter value 2029.

etc.

Userlevel 2
Badge +6

Unfortunately, it is only parameters of datatype DATE where you can enter calculations, and only if you use the text sysdate in it. new_year_ is not a date so you will always get exactly what you type in to that method.

 

The only way is then to schedule it to run for this year (2023) with value 2028.

Then create another schedule next year with parameter value 2029.

etc.

Thank you for this information! Unfortunately not what I was hoping for, but at least helps me understand why I was unable to get it to work and forces me to come up with a different plan to make sure it stays updated.

 

Reply