logo

NJP

Clearing Catalog Variable Reference Fields

Import · Aug 01, 2012 · article

When clearing a Reference catalog variable in a script, DO NOT use the

g_form.clearValue('fieldName')

method - it will not hide the Reference Icon, nor reset the mandatory field flag to red, possibly leading to confusion. Use

g_form.setValue('fieldName','')

instead.

image

Using

clearValue

will also mess up your UI Policies, so make sure you do not use that method on Reference variables.

View original source

https://www.servicenow.com/community/in-other-news/clearing-catalog-variable-reference-fields/ba-p/2293694