Can we use GlideSchedule() & GlideDateTime() API's in client scripts?

Shantharao
Kilo Sage

Hello All,

I have a requirement to exclude weekends and bank holidays, hence I am using GlideSchedule() & GlideDateTime() API's in server side scripts, can we use these APIs in client scripts?
what are the best practices to use these below two APIs

GlideSchedule()

GlideDateTime() 

 

Thanks

1 ACCEPTED SOLUTION

RaghavSh
Kilo Patron

You need to use GlidAjax and use these APIs in script include.

 

These are server side APIs and should not be used in client side code.


Raghav
MVP 2023

View solution in original post

3 REPLIES 3

RaghavSh
Kilo Patron

You need to use GlidAjax and use these APIs in script include.

 

These are server side APIs and should not be used in client side code.


Raghav
MVP 2023

Ankur Bawiskar
Tera Patron
Tera Patron

@Shantharao 

Those are available only in server side so you cannot use in Client Side.

Please use GlideAjax if you wish to use it in client side

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Gaurav Shirsat
Mega Sage

Hi 

These are the Server Side API which are used in DB Operation.

There are 3 ways to get Server Side Data from Server to Client.

getReference() with call back function,display Business Rule with g_scratchpad object,client callable Script Include.

Please use the GlideAjax API in your client script and write one client callable script include.

call that script include using the GlideAjax

please refer this

https://community.servicenow.com/community?id=community_video&sys_id=0ca16fae1bc50050ada243f6fe4bcb6...

 

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat