MobileGlideForm (g_form) - removeDecoration(String fieldName, String icon, String text)

Removes a decorative icon from next to a field.

Table 1. Parameters
Name Type Description
fieldName String The field name.
icon String The icon to remove.
text String The text title for the icon.
Table 2. Returns
TypeDescription
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');			
      });
      }