- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 06:16 AM
Hi all,
I want comments to be updated in requested item when an attachment is attached with the details like :
Attachment added to $RITMNumber$.
File name : $Filename$ by $Createdby$ at $created$
I would prefer a insert Business rule. So when attachment is added from portal also it would trigger.
so should i write the business rule on "sys_attachment" table or "sc_req_item" table.
Note: sys_attachment has no reference fields and just saving attachment with the table name in which its added into.
also can you please help me with the script for Business rule.to attain the infomation in comments like item number date etc..
Thank you .
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 06:27 AM
Add a insert BR in Attachment Table with condition that current.table_name == "sc_req_item"
BR:
updateRecordForAttachment();
function updateRecordForAttachment(){
var gr = new GlideRecord(current.table_name);
if(gr.get(current.table_sys_id)){
gr.work_notes = "Attachment: " + current.file_name + " has been attached.";
gr.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2021 02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2024 12:19 PM
This is a great solution but i'm trying it in Utah release and the script is not working on creation of a new record. I'm using it for attachments to sn_si_request, and even when i set it to before and after create it's only adding the comments for attachments when the sn_si_request record is created. Any thoughts on how to get it to work when the attachment is added to a record on create?