Skip to content

Commit b9b7055

Browse files
authored
Create Attachment Variable Fix.js
1 parent 375f38a commit b9b7055

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//Run this Business Rule async Insert on the sc_req_item table if using the attachment type variable in a Catalog Item
2+
(function executeRule(current, previous /*null when async*/) {
3+
var gr = new GlideRecord("sys_attachment");
4+
gr.addQuery("table_name", "ZZ_YY" + current.getTableName());
5+
gr.addQuery("table_sys_id", current.sys_id);
6+
gr.query();
7+
while (gr.next()) {
8+
gr.table_name = current.getTableName();
9+
gr.update();
10+
11+
}
12+
})(current, previous);

0 commit comments

Comments
 (0)