Skip to content

Commit 3d1ff94

Browse files
Create README.md
1 parent 0d7a3d6 commit 3d1ff94

File tree

1 file changed

+16
-0
lines changed
  • Server-Side Components/Business Rules/Move attachment from variable to record

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
**Scenario**:
2+
3+
In some catalog items, we might want to make attachments mandatory based on certain conditions.
4+
To achieve this, we typically use an Attachment variable on the catalog item.
5+
6+
When a user submits the catalog item, any attachments uploaded through this variable are stored in the sys_attachment
7+
table with the table name set to the variable’s source — usually ZZ_YYsc_cat_item_producer.
8+
However, in certain cases, we might want these attachments to be associated directly with the RITM (sc_req_item) record instead of staying linked
9+
to the variable.
10+
11+
**Solution**:
12+
13+
We can create an After Insert Business Rule on the sc_req_item table that automatically reassigns such attachments to the corresponding RITM.
14+
15+
This rule will run only for RITMs created from specific catalog items as defined in the filter condition of BR and query the sys_attachment table for records where
16+
table_sys_id matches the current RITM’s sys_id, and table_name equals 'ZZ_YYsc_cat_item_producer' and update the table_name to 'sc_req_item'.

0 commit comments

Comments
 (0)