Skip to main content
Solved

PM Calendar Generation ORA-01841: (full) year must be between -4713 and +9999, and not be 0


Forum|alt.badge.img+5

Our maintenance pm calendar generation has been failing for the last couple days, and we can no longer get into Maintenance Plan on a PM Action. I have narrowed it down to the PM Plan Horizon definition.

 

 

I believe it was setup this way to not have to remember to update this every year or so. 

In our test environment I have changed this value to 2025, and all is well. But I can’t change it back without unchecking the Validation Enabled box.

 

Specifically it fails here in the Maintenance_Configuration_API:

FUNCTION Get_Def_Dem_Mat_Horizon RETURN NUMBER
IS
   
   FUNCTION Core RETURN NUMBER
   IS
        mat_horizon_ NUMBER;
   BEGIN
      mat_horizon_ := TO_DATE( Object_Property_API.Get_Value('MaintenanceConfiguration', '*', 'PM_PLAN_HORIZON')||'12'||'31','YYYYMMDD')- SYSDATE;
   RETURN mat_horizon_;
   END Core;

BEGIN
   RETURN Core;
END Get_Def_Dem_Mat_Horizon;

 

This has not been changed for my guess is 2+ years.

Any idea on how to keep it dynamically updating?

Is this related to leap year?

Best answer by Buddhika Kurera

@nkiphuth Adding a statement is not a viable option for the Object Property Value of PM_PLAN_HORIZON. It has to be a 4 digit number like 2027 or 2030 etc. That is why you are getting the validation error, when Validation Enabled is ticked.

AFAIK, there is no out-of-box capability to auto update the Property Value.

Hope this helps !

 

View original
Did this topic help you find an answer to your question?

3 replies

Buddhika Kurera
Superhero (Employee)
Forum|alt.badge.img+15
  • Superhero (Employee)
  • 388 replies
  • Answer
  • February 4, 2024

@nkiphuth Adding a statement is not a viable option for the Object Property Value of PM_PLAN_HORIZON. It has to be a 4 digit number like 2027 or 2030 etc. That is why you are getting the validation error, when Validation Enabled is ticked.

AFAIK, there is no out-of-box capability to auto update the Property Value.

Hope this helps !

 


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Customer)
  • 10 replies
  • February 5, 2024

Thanks for the clarification. Any thoughts on how it was able to be set like that in the first place(with a statement and validation box checked)? We’ve only had IFS consultants on premises for our installation of the maintenance module. My guess is that this is set as shown above at other companies as well.


Buddhika Kurera
Superhero (Employee)
Forum|alt.badge.img+15
  • Superhero (Employee)
  • 388 replies
  • February 13, 2024

@nkiphuth I m actually not sure how it was done. It cannot be done through the user interface with the validation is on.

Furthermore, to automate it is possible to use an event and event action (online SQL statement). The event could be the Generation of Calendar and then in the event action the Horizon can be extended accordingly (checking the validity of the generated calendar).

Hope this helps and thanks for making the answer !


Reply


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