How to delete an item via Server Side Script [Solved]?

Hi,
I am generating some new item codes based on a server side script on a particular event, may anyone please let me know how to delete those item codes back on a particular event?

Note: In this case, that item will not be used anywhere.

Regards
Ruchin Sharma

use frappe.delete_doc(doctype, name) to delete the document.

@makarand_b
Thanks a lot for your quick response.

I will try and let you know.

Thanks and Regards
Ruchin Sharma

@makarand_b
Its working fine for me, thanks a lot.

Regards
Ruchin Sharma