Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

GlideSubstituteURL().generateURL

shalinichiluka
Kilo Contributor

Hi All,

Can anyone explain me the usage of 'GlideSubstituteURL().generateURL' in the script below or in general.

Script:

template.print("<br />");  

var gr = new GlideRecord("kb_knowledge");

gr.addQuery('source', current.sys_id);

gr.query();

while (gr.next()) {

var link = new GlideSubstituteURL().generateURL(gr, '');

var title = gr.number;

  if (gr.short_description != '') {

  title+= " - " + gr.short_description;

  }

5 REPLIES 5

template.print prints out content in email notifications.



In your script there, template.print is printing out an anchor tag (or hyperlink), with a link back to the GlideRecord, to the email notification.