Check for Attachments on Service Portal

mattrom1
Giga Expert

We have a onsubmit script for CMS that worked fine but this is not working on Service Portal.

function onSubmit() {

    //Type appropriate comment here, and begin script below

      var sys_id=gel('sysparm_item_guid').value;

    var gr = new GlideRecord("sys_attachment");

    gr.addQuery("table_name","sc_cart_item");

    gr.addQuery("table_sys_id",sys_id);

    gr.query();

    if (!gr.next()) {

              alert("Please attach the 'Desktop Software Security Review' filled out form before submitting this request");

          return false;

      }

}

Am i missing something that can cause it not to work on Service Portal

5 REPLIES 5

Ahh!! good to know that Mark. Will be looking forward to making use of this once we're on Madrid. Thanks for sharing this knowledge.