The CreatorCon Call for Content is officially open! Get started here.

Service Portal - Custom Attachment Button on Service Catalog

Joey Wan Kenobi
Tera Guru

Does anyone know how to add make a custom attachment button widget work on the service portal for the service catalog?

In Helsinki, this worked fine:

<a href="javascript:void(0)" class="panel-button sp-attachment-add" onclick="jQuery('#attachment_add').click();">

  <span class="glyphicon glyphicon-paperclip"></span>

</a>

In Jakarta patch 6, the button no longer responds (it does nothing). Can anyone help?

1 ACCEPTED SOLUTION

nathanfirth
Tera Guru

Check out the widget I've posted on ServicePortal.io, there I have an example of a custom widget that triggers the attachment.



https://serviceportal.io/downloads/require-attachments/


View solution in original post

20 REPLIES 20

Hi Nathan - I just downloaded this and it seems to work fine as a required attachment.  How would I make this work on a catalog item where I only require that attachment under certain conditions (via a UI Policy)?  It looks like that isn't working OoB because the update set is published as a scoped app.  Would I need to recreate everything in the scoped app as unscoped records?

Thanks.

Sorry just seeing this now... it's just a widget embedded in a variable set, feel free to clone the widget into Global scope and you can add any needed logic.

Hi Nathan, I uploaded your widget and it works if I drag in a file, but the button gives me the following error in my console:

find_real_file.png

Also, where can I access the code for your widget so I can see and learn how you implemented this?  Thanks!

What version of ServiceNow are you using? Is it a Record Producer or Catalog Item? It's just a Variable Set with an embedded widget. If you navigate into the Variable you can access the widget where you can make any needed changes.

We are in NY and am trying to use it in a Record Producer