After deleting the attachment its still stored into the sys_attachment table

Sovan
Tera Contributor

We have created a custom attachment field for our record producer. When user is going to create a record with an attachment, before submitting the record first they attach the attachment and then they deleted that and again they attached a new one. 

However that deleted attachment has been stored into the sys_attachment table with prefix ZZ_YY and the new attachment has been stored properly.

 

We need to remove that deleted attachment (prefix ZZ_YY) from the sys_attachment table while submitting the record with the new attachment.

Please help to solve this.

15 REPLIES 15

Sovan
Tera Contributor

HI,

No its not taking the logs as well.

 

Sovan_0-1671548163240.png

You can see the above is our custom attachment field. When we attach the attachment and then we delete that before submitting the record, its still storing into the sys_attachment table with prefix ZZ_YY.

@Sovan Logs will be added to syslog table. please check there

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale I checked there only, but that logs did not logged to the syslog table.

Sovan
Tera Contributor

@jaheerhattiwale  its not working as per your solution.

Please help with other solution.

@Sovan It should work. Please do some trial and error.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023