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

I implemented it like that so it could be used only when needed on some record producers without modifying the OOB widget.



sn-attachment-button is an Angular directive that displays the attachment button and includes the controller logic need to facilitate the upload.



Since Service Portal is built as a single-page app with Angular.js, it also adds considerable complexity to things like file uploads for security reasons, since now it's all client side.


I wonder why sn-attachment-button was non-responsive then.


Nathan,



I was able to use your code and it works.



Thank you


Any chance this will work in an order guide?  This would solve a ton of problems for a bunch of people who want to attach docs to order guides in the portal.  I've tried to attach it inside a record producer that was part of an order guide and no go 😞

Thanks Nathanfirth 🙂 Its working fine