Notifications

38 views

Symptoms


When a user tries to submit a catalog item or order guide in Service Portal there is no verification mechanism to determine if an attachment has been added to it or not.

Release


All releases

Cause


Unfortunately, there is currently no out-of-box supported method to check if an attachment has been added or not for a catalog item/order guide in Service Portal.

Resolution


No resolution at this time but one may consider writing an onSubmit client script to go into the sys_attachment table to check if an attachment is present or not for a particular catalog item / order guide.

Some code snippet relating to it:

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 something before submitting this request");
return false;

}

(Please note the above script is NOT the solution but just a starting point on how to achieve the desired behavior)

Additional Information


The following community post has some hints on how to achieve the behavior through using an UI Script and a client script:

Check for Attachments on Service Portal

Article Information

Last Updated:2019-01-15 16:29:22
Published:2019-01-16