Attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2023 12:30 AM
Requirement is On click of a button on Case table, new Case Record(child) should open in new tab by copying description, shot description and attachments from parent case and user can attach more attachments and submit the case.
Issue is description, shot description are copying from parent case to child case but attachments which are copied from parent case are not visible on the Child Case form but when we click on paperclip icon attachments are visible there.
Please, help me in solving the issue so that attachments should be visible on the child case form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 12:28 AM
Since you are opening the new record in a new tab, you should create the child record first, copy the attachments on it and then redirect the user to the new tab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 12:36 AM
But to copy the attachments we need unique id, we will get unique after form loads if I am correct

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 12:55 AM
Can't you use the following
var hrCase = new GlideRecord('sn_hr_core_case');
hrCase.initialize();
hrCase.short_description = 'some description';
hrCase.parent = current.sys_id;
var childCaseSysID= hrCase.insert();
var attachment = new GlideSysAttachment();
var copiedAttachments = attachment.copy('sn_hr_core_case', current.sys_id, 'sn_hr_core_case', childCaseSysID);
action.setRedirectURL(hrCase);
Here user is redirect to the new record when the attachments have already transferred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 01:35 AM
Thank you for your reply
Here record is creating and copying the attachments. But my requirement is attachments should be copied to new unsaved record and user will save/submit the record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 02:38 AM
On the new record, you will not be able to see the attachments copied via script until the record is saved.