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

Service Portal UI Script or Reusable functions in Client Scripts

lucr
Kilo Expert

Hi,

We are working hard to get the service portal working however we've encountered an issue and we do not know the solution as of yet.

We have around 400 catalog client scripts in our current Catalog. Most of them do basic form validations. Which are all client side. Such as checking if the field value is an correct email address, or checking if the field is a number between 4 and 20. And so forth. We've created a UI script to hold all these functions and only call the UI script from the catalog client script. This way we don't have to copy the script every time.

Now in Service Portal (which we love btw) the UI script is not loaded anymore (confirmed by HI Support). So my question is how can we create a re-usable client side library that we could call in our catalog client scripts?

Thnx for your help!

Greets,

Luc

1 ACCEPTED SOLUTION

James_Neale
Mega Guru

Hey Luc,



It sounds like you're using a global UI script. To use it in Service Portal, you need to add it to the theme.



Service Portal -> Themes -> click on your theme.


In the related list JS Includes, click New.


The default type should be UI Script - choose your UI Script in the reference field. Fill in the other fields and save.



That should be it!


Cheers


James


View solution in original post

6 REPLIES 6

lucr
Kilo Expert

Yes is working perfectly:)


J_ DeLuna
Tera Contributor

Hi,



We're currently using a technique we created using Service Portal widgets and variable sets to include the functions. We can pretty much create any function we need to include anything that might need to run server-side.



Take a look, try it out. I'm curious to know if this is something that you could use in your application or if you could see it expanded to use in your application.



Cheers



Supercharging Service Catalog for Service Portal