Scoped GlideElement - getTableName()

Returns the name of the field's table.

Table 1. Parameters
Name Type Description
Table 2. Returns
Type Description
String Name of the table. The returned value may be different from the table Class that the record is in. See Tables and Classes in the product documentation.
if (current.approver.getTableName() == "sysapproval_approver") {
  if (current.approver == email.from_sys_id)  {
     current.comments = "reply from: " + email.from + "\n\n" + email.body_text;
   // if it's been cancelled, it's cancelled.
  var doit = true;
  if (current.state=='cancelled')
      doit = false;
  if (email.body.state != undefined)
     current.state= email.body.state;
   if (doit)
} else {
   gs.log("Approval for task ("+current.sysapproval.getDisplayValue()+") rejected because user sending 
           email( "+email.from+") does not match the approver ("+current.approver.getDisplayValue()+")");