GlideRecord - getRecordClassName()

Retrieves the class (table) name for the current record.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String Class or table name

Scoped equivalent

To use the getRecordClassName() method in a scoped application, use the corresponding scoped method: Scoped GlideRecord - getRecordClassName().

function TaskAssignmentFilter() {
  var classname = current.getRecordClassName();
  var filter = "type=null";
  if (classname == "incident" && current.category == "database") {
    filter = GetGroupFilter("database");
  }
  else {
    // append exclusion for 'catalog' to the filter
    var cat = new GlideRecord("sys_user_group_type");  
    cat.addQuery("name", "catalog");
    cat.query();
    if (cat.next()) {
      filter += "^ORtype!=" + cat.sys_id;
    }
  }
  gs.log("TaskAssignmentFilter: " + filter);
  return filter;
}