- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I stumbled across a new Fuji feature a while back around script includes and ajax calls that I thought was pretty handy. I haven't seen much about it on the community so I figured I'd call it out here.
If you've ever used GlideAjax in ServiceNow to run some server side code from a client script you know that there are two parts to the process. You need to initialize GlideAjax from the client side, most likely from a client script, and then you also need a script include on the server side where you'll run your server side code.
If you're like me you probably start by copying the client side code from the wiki article and changing the parameter names, and then you do the same with the server side code and change the function names. In Fuji this has gotten a little easier.
If you're creating a standard script include to be used server side, the functionality has been around a while where ServiceNow will fill in some starter code after you name your script include.
The problem with doing this for a script include that needs to be called from the client is that you need to extend the AbstractAjaxProcessor object and you don't want to override the initialize function. Well, in Fuji at this point you can check the Client callable checkbox and voila!
The nice thing about this is you don't have to do anything differently than you normally would, and it saves you the time of copying and pasting from the wiki article.
If you find this article helps you, don't forget to log in and "like" it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
