Notifications

743 views

Description

Having an onLoad setValue client script causes the catalog item to have a "dirty form".

Steps to Reproduce

 

  1. Upload the two XML files attached to this problem record:

    • catalog_script_client_c7f83b95db5193003bacf8231f9619fb.xml
    • item_option_new_aa973f1ddb119300a1cff4a51f961976.xml

    This will add the Catalog client script "OnLoad openedby info" (/nav_to.do?uri=catalog_script_client.do?sys_id=c7f83b95db5193003bacf8231f9619fb) and the variable "requestedFor" (/item_option_new.do?sys_id=aa973f1ddb119300a1cff4a51f961976&sysparm_record_target=item_option_new&sysparm_record_row=1&sysparm_record_rows=8&sysparm_record_list=cat_item%3D3a25637b47701100ba13a5554ee490a0%5EORDERBYorder).

    The XML will be added to the record producer Service Category Request (/sc_cat_item_producer.do?sysparm_nostack=true&sys_id=3a25637b47701100ba13a5554ee490a0&sysparm_view=).

  2. Navigate to Self-Service > Service Catalog.

  3. Click on the "plus" icon (+) next to the Search catalog bar at the top right corner.

  4. For sections, navigate to Catalog categories > Departmental Services > Catalog Details & Category Items.

  5. Add both these items to the Service catalog.

  6. Impersonate the user System Administrator.

  7. Navigate back to Self-Service > Service Catalog and go to Department Services > Service Category Request.

    The catalog client script will add the user System Administrator to the Request For field.

  8. Click on any modules on the left side.

    You will be prompted with "Do you want to leave this site" because the form is a "dirty form" (one that enables users to attempt to leave a page without submitting a form they have entered data into).

Workaround

The following line in the script:

g_form.modified = false after the setValue call

will prevent the dirty form from firing.


Related Problem: PRB1268040

Seen In

Kingston Patch 4

Intended Fix Version

Madrid

Fixed In

Kingston Patch 6 Hot Fix 3
Kingston Patch 8
London Patch 1

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-10-24 05:46:42
Published:2018-07-15
catalog_script_client_c7f83b95db5193003bacf8231f9619fb.xmlitem_option_new_aa973f1ddb119300a1cff4a51f961976.xml