elloAttachment not visible in a record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:19 AM
Hello,
I have an issue with displaying the attachment from a request that was submitted from a multiple-row variable set catalog item.
As you can see the attachment has been added:
however, when I preview the created record I do not see this attachment:
Here is the expected result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 05:33 AM
When using the attachment type variable, the attachment appears in the Activity Stream on the record, not at the top as when using the paper clip icon. I assume this is the same when the variable is within a MRVS, but haven't tested this. To get the attachment to appear at the top of the record you can create an Async After Insert Business Rule on the record producer table:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "ZZ_YY" + current.getTableName());
gr.addQuery("table_sys_id", current.sys_id);
gr.query();
if (gr.next()) {
gr.table_name = current.getTableName();
gr.update();
new global.VariableUtil().copy(gr.sys_id, current.getTableName(), current.sys_id);
}
})(current, previous);