attachment REMOVE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 12:17 AM
HELLO DEVELOPERS,
I need to remove/delete attachment on change of a variable on service catalog on portal
I am using 'gel' in onchange client script
var id_object = gel('sysparm_item_guid');
var cart_item_sys_id = id_object.value;
But i am getting browser error - saying 'gel' is not defined.
Can someone tell me how i can get that sysID (the value that gets stored tablesys_id when attachent is added on portal)
Any suggestion is appreciated, Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 03:19 AM
Hello @servicenow14710 ,
Yes I am also referring to the same column.
By default, System does not clear the value of this column on attachment table even if record is not submitted & attachment was attached before submission.
It assigns a value to this column basis on framework which generates unique sys_id for all the records in ServiceNow (whether they are submitted or not submitted/just opened and closed without operation).
Kindly mark this as Accepted Solution/Helpful if it helps & help in closing the thread.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 03:57 AM
Hello @ShubhamGarg : Thanks for the reply, Actually in my implementation, onchange of any variable on form, is it possible to delete the attachments which are attached (using out of the box attachment option).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 05:01 AM
Hello @servicenow14710 ,
I understand your point. I tried it in my instance on sys_attachment and sys_attachment_doc table.
If we attach an attachment using catalog item (after try it & before submission), ServiceNow creates an attachment record but with random table sys_id (system generated for new record).
The only two columns which are related are - Table (coming as target table backend value) and Created by (by logged in user). There is even no hash generated for such record (which is strange).
I referred this doc also - https://docs.servicenow.com/bundle/xanadu-platform-administration/page/administer/table-administrati...
but nothing significant.
I would suggest you raise a HI ticket to get an answer to this situation and let us know.
Hit the like button if you my find my efforts & comments helpful.
Thanks,
Shubham