How to use getSCAttachmentCount in System UI -UI Script GlobalCatalogItemFunctions

klefevre
Tera Contributor

I'm using the getSCAttachmentCount function in GlobalCatalogItemFunctions to check to see if an item was attached to my request before allowing the request to be submitted.  I get the error "Failed to load resource: the server responded with a status of 404 - Not Found" when I get to the point of calling the function.  If I go to System UI | UI Scripts in the explorer window, I can find the function, so I know it exists.  

When I got to Service Portal | Portals and select my portal, under Theme | JS Includes, I see GlobalCatalogItemFunctions.

What more do I need to do to get it to work?

 

 

6 REPLIES 6

Michael Fry1
Kilo Patron

New in Madrid is the Portal Settings tab on catalog items where you can check Mandatory Attachment without the use of any scripts. Can you use this option:

find_real_file.png

This option doesnt seem to work for me. Can anyone help ?

klefevre
Tera Contributor

Michael:

 

Thanks for your reply.  It fixed the basic problem.  One extra wrinkle that I failed to mention is that there must be 2 attachment.  Your solution is perfect if only 1 requirement is needed.  I didn't see a way to specify the number of required attachments.  Is there one with your method?  

klefevre
Tera Contributor

It turns out the fix is simple.  Open up the GlobalCatalogItemFunctions UI Script.  Just below the name on the left side of the screen is the attribute UI Type.  On our instance, it was set to "Desktop".  It needed to be changed to "Mobile / Service Portal".  Once the change was made, the problem went away.