ServiceNow Cheat Sheets · LessonReviewed by Sneha I, ServiceNow Trainer, 8 yrs · Updated · Published · current release · reference
ServiceNow Scripting cheat sheet
Client vs server context and the objects you use.
Quick answer
Where ServiceNow code runs decides which objects exist. Server side: gs for logging, user and utilities, GlideRecord for the database, current and previous inside business rules. Client side: g_form to read and write form fields, g_user for the current user, GlideAjax to call the server. Security and data integrity belong on the server; the client is only for UX.
Key takeaways
- Server side
- Client side
- Rule of thumb
Know where your code runs and which objects are available.
Server side
gs, logging, user, utilities.GlideRecord, database access.current/previous, in business rules.
Client side
g_form, read/write fields on the form.g_user, current user info.GlideAjax, call the server.
Rule of thumb
Security and data integrity belong on the server. The client is only for UX.
Practise this on your own free instance.