When saving a Change Request record with both the Planned Start Date and the Planned End Date fields populated, the error message "Planned end date must be after Planned start date" is displayed preventing the change from being saved.

The error occurs when the system or user's date format is changed to a format other than yyyy-MM-dd (for example, dd-MM-yyyy or MM-dd-yyyy).

The client script Planned End Date Validation does not take into account date format changes and validates the dates incorrectly.

This error occurs on Eureka instances prior to Patch 5.

Steps to Reproduce

  1. Log in to a base system instance running Eureka (pre-patch 5).
  2. Navigate to the sys_properties.LIST.
  3. Set the glide.sys.date_format property to [dd-MM-yyyy].
  4. Navigate to Change request > Create New.
  5. Set the Planned start date to today.
  6. Set the Planned end date in the future.
  7. Save or submit the change request.
    The error message Planned end date must be after Planned start date appears on the top of the form.


As a workaround on Enterprise Edition, you can replace the Planned End Date Validation client script with the following function:

function onSubmit() {
    var startDate = g_form.getValue("start_date");
    var endDate = g_form.getValue("end_date");
    var format = g_user_date_time_format;

    if (startDate == "" || endDate == "")

    // compareDates return values we're testing:
    //  1 if startDate is greater than endDate
    // -1 if either of the dates is in an invalid format
    var result = compareDates(startDate, format, endDate, format);

    if (result == 1) {
        g_form.addErrorMessage(new GwtMessage().getMessage("{0} must be after {1}", g_form.getLabelOf("end_date"), g_form.getLabelOf("start_date")));

        return false;

    } else if (result == -1) {

        if (!isDate(startDate, format))
            g_form.addErrorMessage(new GwtMessage().getMessage("{0} is invalid", g_form.getLabelOf("start_date")));

        if (!isDate(endDate, format))
            g_form.addErrorMessage(new GwtMessage().getMessage("{0} is invalid", g_form.getLabelOf("end_date")));

        return false;

    return true;
Note: Overriding the out-of-box code will create a customer update record in the sys_update_xml table. It should be deleted to ensure this script is not skipped during an upgrade.

Related Problem: PRB604584

Seen In

Dublin EA 8
Eureka Patch 1
Eureka Patch 1 Hot Fix 2
Eureka Patch 2
Eureka Patch 2 Hot Fix 1
Eureka Patch 3 Hot Fix 1
Eureka Patch 4
Eureka Patch 4 Hot Fix 1
Eureka Patch 4 Hot Fix 4
Eureka Patch 5
Fuji Patch 9 Hot Fix 1

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2016-07-25 12:36:37