Copying Attachments from Parent to Child
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 07:55 AM
Hello all,
I have a question on how to get all of the parent attachments onto the child automatically. I currently have made a Business rule on the Parent table.
I feel like there is something obvious that I am missing. Any help is appreciated. Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 07:59 AM
GlideSysAttachment.copy('sourcetable','sys_id','destinationtable','sys_id');
this is an easy script to copy attachment from one record to another.
you should do this from the child table and not the parent.
pull in the parent sys_id using the parent field on the child task.
GlideSysAttachment.copy('change_tack',current.sys_id,'change_request',parent.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:29 AM
it looks the the parent field isnt on the change_task table. It is actually change_request.
the script should be
GlideSysAttachment.copy('change_tack',current.sys_id,'change_request', current.change_request);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:38 AM
Still no luck unfortunately... any other ideas?