Solved

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

  • 2 February 2024
  • 3 replies
  • 82 views

Userlevel 1
Badge +4

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?

icon

Best answer by Buddhika Kurera 4 February 2024, 15:44

View original

3 replies

Userlevel 6
Badge +13

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

 

Userlevel 1
Badge +4

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.

Userlevel 6
Badge +13

@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