Request Number should reflect as hyperlink in the notification, but current.number is getting printed

EKTA2
Tera Expert

Hi All, I am writing an email script so as to get Request number as a hyperlink in the notification. But I am getting current.number instead. It is taking me to correct record so means that the hyperlink is correct but I want it to show Request number i.e. REQ123456 not current.number. 

 

Also, I am not sure why task has quote in front of it? output given below. 

 

 

var id = current.sys_id;
var sLink = "task.do?sys_id="+id;
template.print("<a href='"+sLink+"'>current.number</a>);

 

find_real_file.png

1 ACCEPTED SOLUTION

vkachineni
Mega Sage
template.print("<a href='"+sLink+"'>" + current.number + "</a>");

View solution in original post

4 REPLIES 4

vkachineni
Mega Sage
template.print("<a href='"+sLink+"'>" + current.number + "</a>");

Also, can you please confirm why there is quotation in front of task? Is it a way to make it a link?

 

var sLink = "task.do?sys_id="+id;

//I would go with this function to create a link to a table.
var sLink = createLinkForObject(current.getTableName(),current.sys_id, current.number);
template.print(sLink);

function createLinkForObject(strTableName, strSysID, number){
   return '<a href="' + gs.getProperty('glide.servlet.uri') + gs.generateURL(strTableName, strSysID) + '">' + number + '</a>';
}


Sure, Thanks!