- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:01 AM
The Below Onload Client script in executing on PDI here accessing data through Glide Record. Is a expected behavior , what should be ideal case for glide Record in client side , is through error or provide output .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:28 AM
@darshan-pra it would work in Native UI but not in portal, scoped app or mobile as mentioned by @Ankur Bawiskar.
The GlideRecord API is the primary means of interfacing with the database on the server-side code. Its best not to mix server side APIs with client scripts as it could break in Service Portal, mobile and future upgrades. Use best practices so that your code is scalable and optimised. ServiceNow has GlideAjax class to call server side script from client side and fetch necessary data, you can make use of it.
Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:18 AM
so it will work in global scope ... ? also could you please provide more info why not recommended and what are then impact are there if used ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:35 AM
@darshan-pra , it may work for native UI but not in portal UI. Also its not about what is working but also about if it is following the best practices. The best practice is to use GlideAjax and for processing between client and server side data.
Thank you,
Mahesh.