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

Community Alums
Not applicable

Hello,

 

I am still getting undefined in preview email option , it stating record not found .

 

Please check 

try this

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

Hello @Community Alums 

 

Check the link which is coming to your browser, after redirecting, It will hep you to debug the issue in the script.

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh