The CreatorCon Call for Content is officially open! Get started here.

email script

Community Alums
Not applicable

Hello Team,

 

I have requirement to hyperlink current record on email script .

 

how we can do this please advise. 

 

 var gr = GlideRecord('u_update_configuration_items');
    gr.addQuery('sysapproval', current.number);
    //gr.addQuery("number", current.sysapproval);
    var url=gr.number;
    gr.query();
    if (gr.next()) {
template.print("<br/>");
        template.print('<a href=' +url + '>CI Admin </a>' );
    }
2 ACCEPTED SOLUTIONS

Rohit01998
Tera Guru

Hello @Community Alums ,

Try this code in email script...

 

var url = 'u_update_configuration_items.do?' + 'sys_id=' + current.getUniqueValue();
template.print("<a href= '"+ url + "'>" + current.number + "</a>");

 

Help others to find a correct solution by marking the appropriate response as correct answer and helpful.

View solution in original post

Mohith Devatte
Tera Sage
Tera Sage

Hello @Community Alums ,

You can try this



var url = "<a href=/u_update_configuration_items.do?sys_id="+current.sys_id.toString()+"> "+current.number+" </a>";
template.print(url);

 

OR

 

if number is the display value in your u_update_configuration_items table just use ${URI_REF} in your notification body with an email script.

 

Hope this helps 

Mark my answer correct if this helps you 

Thanks

View solution in original post

7 REPLIES 7

Karthiga S
Kilo Sage

Hi @Community Alums 

 

Please find the related article - https://servicenowguru.com/system-definition/email-notifications-system-definition/email-links-uri-uriref/

 

Please mark it Correct and Hit Like if you find this helpful!

 

Regards,

Karthiga

 

 

 

Rohit01998
Tera Guru

Hello @Community Alums ,

Try this code in email script...

 

var url = 'u_update_configuration_items.do?' + 'sys_id=' + current.getUniqueValue();
template.print("<a href= '"+ url + "'>" + current.number + "</a>");

 

Help others to find a correct solution by marking the appropriate response as correct answer and helpful.

Community Alums
Not applicable

Hello Rohit,

 

I am getting this undefined in notification .

 

Please help 

Mohith Devatte
Tera Sage
Tera Sage

Hello @Community Alums ,

You can try this



var url = "<a href=/u_update_configuration_items.do?sys_id="+current.sys_id.toString()+"> "+current.number+" </a>";
template.print(url);

 

OR

 

if number is the display value in your u_update_configuration_items table just use ${URI_REF} in your notification body with an email script.

 

Hope this helps 

Mark my answer correct if this helps you 

Thanks