Deleted attachment still shows up on catalog

Kumar38
Kilo Sage

I created a script in workflow to delete image in "Picture" field on catalog item. Script deleted the attachment  .But the image still shows up on the form. 

 

 

var gr2 = new GlideRecord('sys_attachment');
			gr2.addEncodedQuery('table_name=ZZ_YYsc_cat_item^file_name=picture^table_sys_id='+sys); //sys = selected catlog item on form
			gr2.query();
			if(gr2.next()) {
			gr2.deleteRecord();
			}

 

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Why are you not going into the catalog item and deleting the picture form there? Why using a script to delete it?

-Anurag

This is a part of request to make direct updates in Production.

As an admin you can do it in prod as well, if you can run the script you can remove the picture

 

AnuragTripathi_0-1697195311083.png

 

-Anurag