How to resolve error "Record Not Found" once clicking on Notification Link

Shivani Sahu
Tera Contributor

Hi All,

I have created notifications for incidents and add link in the message content at last called "Take me to the incident" for users who wanted to view the record directly from the email. So after clicking the link we are getting one error called "record not found" only while logged in. link has open on the other browser and we have to logged In to see the record after login we gets that error. Once login then we tried to click on link its working fine user will get the records. I am not sure why its happening while logged In. Please share the inputs if anyone knows the issue, so that I resolve it.

I have attached notification content and link which I have added.

find_real_file.png

1 ACCEPTED SOLUTION

Mahendra RC
Mega Sage

Hello Shivani,

Please use the below code to set the Incident reocrd URL

Using only var link = "<a href='/incident.do?sys_id='"+current.sys_id+">Take me to the incident</a>"; will create an issue when user is not logged in ServiceNow and directly clicks the link from email.

var link = '<a href="https://' + gs.getProperty("instance_name") + '.service-now.com/incident.do?sys_id=' + current.getValue("sys_id") + '">Take me to the incident</a>';

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

View solution in original post

12 REPLIES 12

Yes Sure, @Mohith Devatte - Please find below snapshot of email script which I have added in the notification content.

find_real_file.png

@Shivani Sahu ,

can you try this in the first line ?

var link = "<a href='/incident.do?sys_id='"+current.sys_id+">Take me to the incident</a>";

and also while printing it just use 

template.print(link);

Hope this helps

please mark my answer correct if this helps you

Thankyou for the above. But its not working please find attached snip of mail script where I have made changes as suggested by you

Mahendra RC
Mega Sage

Hello Shivani,

Please use the below code to set the Incident reocrd URL

Using only var link = "<a href='/incident.do?sys_id='"+current.sys_id+">Take me to the incident</a>"; will create an issue when user is not logged in ServiceNow and directly clicks the link from email.

var link = '<a href="https://' + gs.getProperty("instance_name") + '.service-now.com/incident.do?sys_id=' + current.getValue("sys_id") + '">Take me to the incident</a>';

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

@mahendra 

I have tried to put the same code but its not working, once clicking on the link its coming on new incident creation page