- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 08:42 AM
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var instance = new GlideRecord('asmt_assessment_instance');
instance.addQuery('task', current.sys_id);
instance.query();
while(instance.next())
{
url = '<a href="'+gs.getProperty('glide.servlet.uri') +'nav_to.do?uri=%2Fassessment_take2.do%3Fsysparm_assessable_sysid=' +instance.sys_id + 'sysparm_assessable_type%3D4b8c6704dbaa7300f3e3a08a4896191f'">'+'Click here'+'</a>';
template.print(url);
}
})(current, template, email, email_action, event);
regards
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 09:07 AM
try
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var instance = new GlideRecord('asmt_assessment_instance');
instance.addQuery('task', current.sys_id);
instance.query();
while(instance.next())
{
url = '<a href="'+gs.getProperty('glide.servlet.uri') +'nav_to.do?uri=%2Fassessment_take2.do%3Fsysparm_assessable_sysid=' +instance.sys_id +'sysparm_assessable_type%3D4b8c6704dbaa7300f3e3a08a4896191f">Click here</a>';
template.print(url);
}
})(current, template, email, email_action, event);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 09:04 AM
Your 'url' variable should hold a String value so the the only time you need a '+' sign is when the string is added to a variable. That being said, you shouldn't need the plus symbol before the 'Click here' part of the url string because it's itself a string; you shouldn't need to add a string to a string. You can also get rid of the quotes surrounding this same section. Your string should look like this:
Hope this answer helped or solved your problem. If so, please mark it as such. Thanks!
James Gragston - CloudPires

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 09:05 AM
Hello,
Please update line 10 to the following:
var url = '<a href="'+gs.getProperty('glide.servlet.uri') +'nav_to.do?uri=%2Fassessment_take2.do%3Fsysparm_assessable_sysid=' +instance.sys_id + 'sysparm_assessable_type%3D4b8c6704dbaa7300f3e3a08a4896191f">Click here</a>';
The text 'Click Here' is already a string and as such does not need to be concatenated into the rest of the URL string.
Hope this helps.
--David

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 09:07 AM
try
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var instance = new GlideRecord('asmt_assessment_instance');
instance.addQuery('task', current.sys_id);
instance.query();
while(instance.next())
{
url = '<a href="'+gs.getProperty('glide.servlet.uri') +'nav_to.do?uri=%2Fassessment_take2.do%3Fsysparm_assessable_sysid=' +instance.sys_id +'sysparm_assessable_type%3D4b8c6704dbaa7300f3e3a08a4896191f">Click here</a>';
template.print(url);
}
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2019 09:09 AM