GlideSystem - getProperty(String key, Object alt)

Gets the value of a Glide property. If the property is not found, returns an alternate value.

Additional information about the method that does not belong in the short description.

Table 1. Parameters
Name Type Description
key String The key for the property whose value should be returned.
alt Object (Optional) Alternate object to return if the property is not found.
Table 2. Returns
Type Description
String The value of the Glide property, or the alternate object defined above.

Scoped equivalent

To use the getProperty() method in a scoped application, use the corresponding scoped method: Scoped GlideSystem - getProperty(String key, Object alt).

//Check for attachments and add link if there are any
  var attachment_link = '';
  var rec = new GlideRecord('sc_req_item');
  rec.addQuery('sys_id', current.request_item);
  rec.query();
  if(rec.next()){
    if(rec.hasAttachments()){
      attachment_link = gs.getProperty('glide.servlet.uri') + rec.getLink();
    }    
  }