Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Attachment mandatory is not working in order guide catalog item but working in individual catalog

harshadakashid
Tera Contributor

I have one order guide name "IT request" where 10 catalog items are there based on rule. I want to make attachment madatory for only 1 catalog item name "corporate device request" where I have written below client script which is working fine when I raised service request only for this catalog item from portal individually but I want to remove this individual catalog item and I have added it in Order guide. When I have added it in order guide. this scriptis not working. count is coming -1 in order guide if i add attachment and count is coming 1 in seperate request.

 

 

I have catalog client script with below code

   try { //Works in non-portal ui
            var attachments = document.getElementById('header_attachment_list_label');
            if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none') {
                alert('You must attach evidence of EC Member approval before submitting this request.');
                return false;
            }
        } catch (e) { //For Service Portal
            var count = getSCAttachmentCount();
            alert(count);
            if (count <= 0) {
                alert('You must attach evidence of EC Member approval before submitting this request.');
                return false;
            }
0 REPLIES 0