Increasing the maximum value for Schedule Duration on a Change Order

Document ID : KB000125191
Last Modified Date : 23/01/2019
Show Technical Document Details
Introduction:
Change Order tickets feature a field called "Schedule Duration" that is intended to define how long a particular Change Order will take to complete. When paired with the "Schedule Start Date" field, this will define the "Schedule End Date" value; it can also be used without a "Schedule Start Date".

The "Schedule Duration" field accepts times in hh:mm:ss format (e.g. 18:52:09), and by default can accept a duration value as large as 9999:59:59, which is over 1.14 years. Attempting to insert a value larger than this will yield the error message below:

Error message: "Schedule Duration: Set duration exceeds one or more of 9999 hours,59 minutes,59 seconds limits in the respective duration fields"

While roughly 1.14 years is typically enough time for most Change Order scenarios, some use cases may arise where the "Schedule Duration" field needs to contain a value larger than 9999:59:59 - for example, a large project is expected to take 18 months to complete, and is being tracked in a Change Order. By customizing two files as detailed below, we can increase the limits on how large of a duration the "Schedule Duration" field will accept.
Instructions:
These steps involve editing script files used by Service Desk Manager. Improperly modifying these files may cause undesired or unexpected operati As with any customization, it is strongly recommended to thoroughly test in a non-Production environment before implementing any change in Production.

There are two files that would need to be modified in order to exceed the 9999:59:59 limitation - val_type.js and msg_cat.js. The val_type.js file contains the actual limitation itself, while msg_cat.js contains the error message. To modify these files, follow the steps below:
  1. Navigate to your Service Desk Manager root folder, then to \bopcfg\www\wwwroot\scripts.
     

  2. Locate the val_type.js and msg_cat.js files. Copy these files. Never modify the files directly within this folder - these are the defaults that SDM will fall back to when no customizations are defined.
     

  3. Navigate to your Service Desk Manager root folder, then to \site\mods\www\wwwroot\scripts. Paste the copied files here.
     

  4. Within val_type.js, locate the following line:

    var date_store = /^([0-9]{0,4}):([0-5]?[0-9]):([0-5]?[0-9])$/.exec(val);
     

  5. Modify the line as follows and save your changes:

    var date_store = /^([0-9]{0,5}):([0-5]?[0-9]):([0-5]?[0-9])$/.exec(val);

    Important: It is not recommended to exceed 99999 hours (five hour digits) due to datatype limitations. Review the Additional Information section below for more information on this.

  6. Within msg_cat.js, locate the following line:

    __messages["Set_duration_exceeds_one_"]="Set duration exceeds one or more of 9999 hours,59 minutes,59 seconds limits in the respective duration fields";
     

  7. Modify the line as follows and save your changes:

    __messages["Set_duration_exceeds_one_"]="Set duration exceeds one or more of 99999 hours,59 minutes,59 seconds limits in the respective duration fields";

    Important: Only modify the message body portion of this line, between the last pair of double-quotes. The "Set_duration_exceeds_one_" section on the left is an identifier for this message, and the message may not work properly if this is modified.

  8. After making your changes, clear SDM’s webcache by running the pdm_webcache -b -H command. Note that this will send all users a one-time prompt to clear their browser cache during their next logon.

After making these modifications, your Change Order detail page will accept a "Schedule Duration" value of up to 99999:59:59. Attempting to exceed this value will yield an error message stating the new current limit.

Additional Information:
The "Schedule Duration" value is stored internally as an INTEGER value, specifically to indicate the number of seconds in the duration. INTEGER datatypes have a maximum size of 2,147,483,647, and as such the maximum possible duration we can store is about 2 billion seconds, which is about 596,523 hours, or 1,634 years. Since we could potentially enter an impossible-to-store value if the field accepted six digits for the hour field (999999:59:59), it is recommended to only increase this to five digits when absolutely necessary.