- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 12:56 AM
Hi Community,
I just want to copy the attachments from demand to project , whenever a new project is created.
Any help will be appreciated.
Thanks,
Reena Kumari
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 01:29 AM
After the project is created (After BR) you can use this to copy attachments from record X to record Y:
GlideSysAttachment.copy('incident', 'sys_id_of_source',' incident', 'sys_id_of_target');
You state the source table and sys_id and the target table and sys_id and it'll copy the attachments to the target record from the source. So in this case your project should have a reference to the demand and you could have a after insert BR on your project table with the following script:
GlideSysAttachment.copy('dmn_demand', current.getValue('demand'), 'pm_project', current.getUniqueValue());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 01:29 AM
After the project is created (After BR) you can use this to copy attachments from record X to record Y:
GlideSysAttachment.copy('incident', 'sys_id_of_source',' incident', 'sys_id_of_target');
You state the source table and sys_id and the target table and sys_id and it'll copy the attachments to the target record from the source. So in this case your project should have a reference to the demand and you could have a after insert BR on your project table with the following script:
GlideSysAttachment.copy('dmn_demand', current.getValue('demand'), 'pm_project', current.getUniqueValue());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:11 AM
Hi Weird, it's working. Thanks for your response.