752 views

Description

Setting a variable to not-mandatory and hidden using a UI policy does not work on the variable editor on a form.

Steps to Reproduce

 

  1. Create a new catalog item.

  2. Create a multiple choice variable with two choices (Choice 1 and Choice 2). Under Type Specifications check Do not select the first choice.

  3. Create two multi-line variables (V1 and V2) and set them to mandatory through the variable checkbox.

  4. Create two UI policies.

    • One applying to the multiple choice variable created when Choice 1 is selected, with a policy action setting V1 visible and mandatory to True, and Reverse if False checked
    • One applying to the multiple choice variable created when Choice 2 is selected, with a policy action setting V2 visible and mandatory to True, and Reverse if False checked.
  5. Click Try it.

  6. Check choice 1.

    It should show variable V1 and be mandatory.

  7. Check choice 2.

    It will hide the V1 variable and make it not-mandatory, and show the V2 variable that was hidden.

  8. Type something on V2 variable and select Order Now.

    Note that you can order the item because the other variable is hidden and not mandatory.

  9. Go to the RITM and make sure that the variable editor shows up in the form.

  10. Test the UI Policy in the RITM form by selecting different choices.

    The variables should be either hidden or shown depending on the choice.

  11. Make sure the V1 variable is empty and hidden, then try updating or saving the form.

    Expected results: The form is updated without any warning or errors since V1 should be hidden and not mandatory.

    Actual Results: The form does not get updated, and shows an error "The following mandatory fields are not filled in: V1"

 

 

Workaround

Create a new system property.

  1. Go to the sys_properties table.
  2. Create a new property with name "glide.sc.use_sc_form_v2" with the Type as true/false, and value as false.
  3. Save the form.

 


Related Problem: PRB1245555

Seen In

Kingston

Intended Fix Version

Kingston Patch 8
London

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-06-20 18:24:03
Published:2018-02-16