Attachment failed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:45 AM
Hello Experts,
We want to copy attachment from "sysapproval_approver" table to change request table.
We have created after insert br tried below code but its not working ,
please support to fix the issue.
After insert BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 02:20 AM
Hi @akin9
Try the following code.
(function executeRule(current, previous /*null when async*/) {
var attachment = new GlideSysAttachment();
attachment.copy('sysapproval_approver', current.sys_id, 'change_request', current.getValue('sysapproval'));
})(current, previous);
Please mark my answer helpful and accept as solution if it helped you 👍✔️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 02:52 AM
Hello @AnveshKumar M ,
Thank you for the Quick reply!
I have tried the above code but no luck. Please check
NOTE: I have tried the for the same copy comments its working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 03:44 AM
Hi @akin9
Are you trying to copy the attachments after the approval is approved or whenever an attachment is added?
And have you checked both Insert and Update fields to true in the Business Rule when to run tab or only insert? If it is only Insert, make Update also checked.
Mean while I'll check this in my PDI.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 03:52 AM
Hi @akin9
I tested this in my PDI, It is working fine with the below configuration. Only exception is you need to update the approval record, either approve it or reject it etc,
If you want it to work whenever the attachment is added, let me know, I'll give the code accordingly.
Anvesh