Make attachment mandatory for catalog item submission

We can use the following catalog client script onSubmit

var gr = new GlideRecord(“sys_attachment”);
gr.addQuery(“table_name”, “sc_cart_item”);
gr.addQuery(“table_sys_id”, g_form.getUniqueValue());
gr.query();

if (!gr.next()) {
alert(“Attachment mandatory.”);
return false;
}