Hi 

Give a final try:

function onSubmit() {

var OwnOther = g_form.getValue('Server_com_decom');
if (OwnOther == 'Commission') {
var cat_id = g_form.getValue('sysparm_item_guid');
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "sc_cart_item");
gr.addQuery("table_sys_id", cat_id);
gr.query();
if (!gr.next()) {
          alert("You must add an attachment before submitting this request.");
          return false;
         }
}

}

 

Thanks

Thanks,
Murthy

View solution in original post