Need to populate custom table field with RITM number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-26-2024 11:27 PM
Hi friends, iam working on a task in which i attach an excel sheet containing records in a catalog item , when i sumbit that catalog item ,records from excel gets populated in custom table. This is done by copying attachement from sc_req_item to datasource followed by transform map its working fine. Now the issue is the custom table contains one field called Ritm number, the field should be populated with the ritm number of reqseted item when ever records is created using the catalog item. How can i achieve this. help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-27-2024 09:20 AM
@Slava Savitsky any update on this task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-27-2024 02:35 AM
@Slava Savitsky Hi am using business rule script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-27-2024 11:09 AM
The copy() method returns sys_ids of the original attachments and their copies. If you track this somewhere (e.g. in a custom table with three columns: ritm_id, attachment_original_id, attachment_copy_id), you would be able to query that table later from a transform map script and find the original RITM by the id of the attachment, attached to the Data Source record.
However, there are some general problems with your solution design that you need to be aware of:
1. With every new RITM, the number of attachments in your Data Source record will grow. You need a mechanism to remove old attachments. This can be done with an onComplete transform map script.
2. If another RITM of this kind is submitted before the previous import has completed, it won't work because the new attachment will be deleted together with the previous one when the import is over. So you probably need to disallow submission of new RITMs of this type until processing of the previous one is completed. This can be achieved via a GlideAjax call from an onSubmit client script in your catalog item.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-27-2024 09:14 PM
@Slava Savitsky Hi can you provide sample script regarding fetching those details to custom table.
To delete the attachments i have post import script in scheduled import.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-27-2024 09:44 PM
@Slava Savitsky what about this script: