Where to find [Update] [Delete] scripts for Image type fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2023 12:00 PM
I am attempting to locate the scripts for the built-in functions (Update, Delete) associated with Image type fields. The [Delete] option wipes the image but leaves behind a SysID value in the field. I'd like to tweak the script to set the field value to "". Are these functions accessible anywhere on the platform? Thank you for any direction you can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 02:16 AM
In the browser function
function deleteUserImage (image_id, table_name, source_field, source_id) {
var ajax = new GlideAjax("AttachmentAjax");
ajax.addParam("sysparm_value", image_id);
ajax.addParam("sysparm_table_name", table_name);
ajax.addParam("sysparm_source_field", source_field);
ajax.addParam("sysparm_source_id", source_id);
ajax.addParam("sysparm_type", "delete");
ajax.getXML(doNothing);
var image = $(image_id);
if (image) {
image.src="images/s.gif";
image.alt = "";
}
var delspan = $(image_id + "_delete");
if (delspan)
delspan.innerHTML = '';
var addanchor = $(image_id + "_update");
if (addanchor)
addanchor.innerHTML = "";
var imagespan = $(image_id + "_image");
if (imagespan)
imagespan.style.visibiity = "hidden";
var noimagespan = $(image_id + "_noimage");
if (noimagespan)
noimagespan.style.visibility = "";
return false;
};
is executed when "Delete" is pressed.
So you should check Script Include AttachmentAjax.
Which should clear the sys_id too.
Perhaps you are not refreshing the record when checking the sys_id?
Or perhaps the OOB Script Include has been modified and no longer works as designed?
(I'm assuming Core UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2024 01:59 PM
I am having this issue too. The sys_id of the image is left behind when pressing delete. I am going to open a HI case.