How to Fix - Unable to save attachments to req/ritm using attachment variable from catalog on Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2024 08:55 AM
Synopsis 1 - Whenever we try to upload attachments using attachment variable, post creating a request it has to save the attachment in the RITM table.
However, the file in the attachment table is created with prefix "ZZ_YYsc_cart_item", post request creation the table name might change to ZZ_YYsc_req_item.
To solve the above issues.
a) you can exclude the anti-virus from the table.
follow the below steps:
1. Go to dictionary, search for sc_cart_item table.
2. use collections column and open the record
3. under attributes, click new and create attribute to exclude_antivirus and set value as true.
4. clear cache and try if it works.
b) if the above doesnt work, follow the below steps:
1. create an async BR on the target table.
2. use the below script and copy the attachment to the target table
(function executeRule(current, previous /*null when async*/) { // Add your code here 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);
3. see if that works, if yes please thank Ankur.
Synopsis 2: We have been experiencing another type of issue while uploading attachment, which doesnt change the table name and stays in ZZ_YYsc_cart_item despite trying to fix the issue with the above remedies.
if such issues occur, please try the below steps
1. Create a before insert or after ( based on your requirement ) on target table.
2. use the script ( my table is ritm table )
- 508 Views