PDF Attachment not comes from HR template to HR task

abirakundu23
Mega Sage

Hi All/ @Anil Lande /@Ankur,

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.

Can we copy attachments from HR templates to HR task form ? - Human Resources Service Delivery - Que...

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.

 

5 REPLIES 5

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

LinkedIn