GlideElement - hasAttribute(String attributeName)

Determines whether a field has a particular attribute.

Table 1. Parameters
Name Type Description
attributeName String The attribute to check for
Table 2. Returns
Type Description
Boolean True if the field has the attribute, false otherwise.

var totalCritical = 0;
 
var filledCritical = 0; var fields = current.getFields(); gs.print(fields); for (var num = 0; num < fields.size(); num++) { 
 
    gs.print("RUNNING ARRAY VALUE " + num);
   var ed = fields.get(num).getED();
   if(ed.hasAttribute("tiaa_critical")) {
       gs.print("CRITICAL FIELD FOUND");
       totalCritical ++;
       if (!fields.get(num).isNil()) {
           filledCritical ++;
       }
   }
 
} var answer = 0; gs.print("TOTAL - " + totalCritical); gs.print("FILLED - " + filledCritical); if (filledCritical > 0 && totalCritical > 0){ 
 
    var pcnt = (filledCritical/totalCritical)*100;
   answer = pcnt.toFixed(2);;    
 
} answer;