PDF Attachment not comes from HR template to HR task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2022 11:09 PM
Hi All/
We want attach pdf documents on HR task for end user. so we use following approach. I have attach a pdf on HR template ,from this attachment comes to HR task.
We want to copy pdf attachment from HR template to HR task. Wrote After/insert BR on task table as per article.
After/insert BR
==============
(function executeRule(current, previous /*null when async*/) {
gs.addInfoMessagedd("Hello pdf in task");
GlideSysAttachment.copy('sn_hr_core_template',cfde0ab387685d5463c853973cbb35e6, 'sn_hr_core_task', current.sys_id);
})(current, previous);
Pdf attachment not comes up.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2022 10:59 PM
Also notice the color highlighting on the sys_id... or actually the missing color highlighting, which indicates something is wrong. In this case, the sys_id should be a string, so between quotes.
copyAtt.copy('sn_hr_core_template', 'cfde0ab387685d5463c853973cbb35e6', 'sn_hr_core_task', current.sys_id);
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field