GlideForm - removeDecoration(String fieldname, String icon, String title)

Removes the icon from the specified field that matches the icon and title.

Note: This method is not supported by Service Catalog.
Table 1. Parameters
Name Type Description
fieldName String Field name.
icon String Name of the icon to remove.
title String The icon's text title (name).
Table 2. Returns
Type Description
void

function onChange(control, oldValue, newValue, isLoading) {
	// if the caller_id field is not present, then we can't add an icon anywhere
	if (!g_form.hasField('caller_id'))
		return;
 
	if (!newValue)
		return;
 
	g_form.getReference('caller_id', function(ref) {
		g_form.removeDecoration('caller_id', 'icon-star', 'VIP');
 
		if (ref.getValue('vip') == 'true')
			g_form.addDecoration('caller_id', 'icon-star', 'VIP');			
	});
}