GlideRecord - getLink(Boolean noStack)

Retrieves the link for the current record.

Scoped equivalent

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

//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();
    }   
  }