Is it possible to call native java classes in service now server side scripts?

prithvirajchaud
Mega Expert

Hi

I am relatively new to service now but i know all the basic development features in the platform. I was looking for some articles on attachments in service now and came across this one SN Pro Tips — Understanding Attachments in ServiceNow . In this article there is a snippet which has a call to a native java class.

find_real_file.png

So my question is, is it possible to call native java classes and methods in service now server side scripts. If yes the can anyone please give me a doc or an article showing which ones are available and how they can be leveraged, plus I would also like to know the pros and cons in using such snippets over service now api.

However, if native java classes aren't callable then why is this an exception?

Thanks in advance

1 ACCEPTED SOLUTION

srinivasthelu
Tera Guru

Hi Prithviraj,



Those days, Java native calls were supported and ServiceNow replaced them with API calls.



As always no transition will happen overnight, so ServiceNow has to leave some marks behind to support such API calls, but officially they are not supported. USE AT YOUR OWN RISK.



Instead, You might have already seen this page .http://wiki.servicenow.com/index.php?title=Packages_Call_Replacement_Script_Objects.


View solution in original post

3 REPLIES 3

srinivasthelu
Tera Guru

Hi Prithviraj,



Those days, Java native calls were supported and ServiceNow replaced them with API calls.



As always no transition will happen overnight, so ServiceNow has to leave some marks behind to support such API calls, but officially they are not supported. USE AT YOUR OWN RISK.



Instead, You might have already seen this page .http://wiki.servicenow.com/index.php?title=Packages_Call_Replacement_Script_Objects.


Can you give me certain links where i can check out examples as to how these apis are used or can be used?


Deepak Ingale1
Mega Sage

I guess the string package call is nothing but GlideStringUtil() API call in ServiceNow.


Link provided by Sri will help you.