Announcing the Global SNUG Board of Directors. Learn more here

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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
Kilo 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

James_Neale
Kilo 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


I have a similar situation where I have a macro invoking UI Script for catalog item. We are trying to move to service portal. I added JS insclue on theme... But it gave me a weird error. Any help will be greatly appreciated....



find_real_file.png



find_real_file.png


alok01
Kilo Contributor

I too am getting the same reference error. Did you find the solution for this?


If yes please share it


rrshah83
Tera Contributor

yes, I was able to resolve. Refer to notes in my article: Re-factoring Catalog Items for Service Portal