Skip to content

Commit 5d13efe

Browse files
authored
Show RITM has Attachment (ServiceNowDevProgram#728)
1 parent 3e4b7d7 commit 5d13efe

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function executeRule(current, previous /*null when async*/) {
2+
3+
// Check RITM for attachments and pass True/False to client via scratchpad
4+
var grAttachment = new GlideRecord('sc_req_item');
5+
grAttachment.addQuery('sys_id', current.request_item);
6+
grAttachment.query();
7+
if (grAttachment.next()){
8+
g_scratchpad.hasAttachments = grAttachment.hasAttachments();
9+
}
10+
11+
})(current, previous);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function onLoad() {
2+
if (g_scratchpad.hasAttachments == true) {
3+
g_form.showFieldMsg('request_item', "Contains attachment(s)",'info');
4+
}
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This feature requires a "Display" Business rule on [sc_task] to pass true/false to the scratchpad and then an "onLoad" Client Script to display a message on the Catalog Task form if the RITM has attachments.
2+
3+
The result is a message on the Catalog Task form (below the RITM field) indicating when a RITM has attachments.

0 commit comments

Comments
 (0)