HR case - While submitting the HR case, the attached document is not getting attached to the HR case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
51m ago
Hi,
Issue: HR case - While submitting the HR case, the attached document is not getting attached to the HR case.
I have a Record Producer that creates an HR Case in the Talent Management COE (sn_hr_core_case_talent_management).
The producer contains an Attachment variable (Variable Type = Attachment) that allows users to upload a file during submission.
When the Record Producer is submitted:
The HR Case is created successfully. The uploaded file is created in sys_attachment.However, the attachment is stored with:
table_name = ZZ_YYsn_hr_core_case_talent_management
instead of:
table_name = sn_hr_core_case_talent_management
As a result, the attachment does not appear in the Attachments related list or on the HR Case
To resolve this issue- I tried by writing after insert BR but since the table sys_attachment is in global scope and the scope of the HR case is HR core application - it did not work.(Scope does not have write access to table sys_attachment).
I also tried updating sys_attachment via Flow Designer, but received:
Scope does not have write access to table sys_attachment, because the flow runs in the HR Core application scope.
When I tried with OOB platform attachment -it did work but I cannot use it as I want attachment mandatory or non-mandatory based on HR case variable inputs.
What is the recommended way to move/reassociate these attachments to the HR Case?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
29m ago
Hi @snehalkausa
Disable ZZ_YY prefix from attachment when added through record producer
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
29m ago
this script worked for my record producer in HR Integrations Scope
I wrote this in record producer script
new global.VariableUtil().copyAttachment(producer.<variableName>,'<tableName>', current.sys_id);
Output
Record Producer Script
File got attached to the HR Case record without any scope issues
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader