Hi friends, thanks for all your support.You are always my encouragement to write new content.
Seeing the response I decided to take leap forward and start composing video tutorials.
I am yet to create a hand full of them.But I am confident your subscriptions and like will be my fuel to create
more feature rich content.
If you feel it is worthy please subscribe my video channel below.
At any time you can click on the to got my youtube
channel
Glide System – Advance scripting in ServiceNow
Glide System – Advance scripting ServiceNow.
This article is a supplement to the ServiceNow documentation. For full
documentation please refer ServiceNow official website
Checkout our NEWVideo Channel you can like
and subscribe too!
Introduction
The GlideSystem (referred to by the variable name gs in Business Rules) provides a number of convenient methods to get information about the system, the current logged in user, etc.
EventQueue
Queues an event for the event manager.
Parameters:
Name of the event being queued.
A GlideRecord object, such as current.
An optional parameter, saved with the instance if specified.
A second optional parameter, saved with the instance if specified.
An event queue to add the event to.
Get Display Column
Gets the display column for the table.
Parameters:
Name of the event being queued.
A GlideRecord object, such as current.
An optional parameter, saved with the instance if specified.
A second optional parameter, saved with the instance if specified.
An event queue to add the event to.
Get Property
Gets the value of a Glide property. If the property is not found, return an alternate value.
log
Logs a message to the system log and saves it to the syslog table.
Parameters:
String message – message to log, for the log’s Message field.
String source – (optional) the source of the message, for the log’s Source field.
nil
Queries an object and returns true if the object is null or contains an empty string.
print
Writes a message to the system log. This method does not write the message to the syslog table unless debug has been activated.
dateDiff
Calculates the difference between two dates. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value.
Use getDisplayValue() to convert the strings to the expected format.
Parameters:
startDate – a starting date to compare, in the current user’s date format.
endDate – an ending date to compare, in the current user’s date format.
boolean bnumericValue – true to return difference in number of seconds as a string, false to return difference in the format ddd hh:mm:ss.
Days Ago
Gets a date and time for a certain number of days ago.
Now Date Time
The current date and time in the user-defined format.
Add Info Message
Adds an info message for the current session. Can be called using getInfoMessages().
Note: This method is not supported for asynchronous business rules.
Get Roles
Gets a list of roles for the current user. The list of roles does not reflect any changes made during the current user session. To get the updated list of roles, the user must log out and log back in.
Get Session
Gets a reference to the current Glide session.
Get User ID()
Returns the sys_id of the current user.
Get Session
Gets a reference to the current Glide session.
Date and Time Functions
Conclusion
That’s all for now. Hope these queries will give you some idea on CRUD operation in ServiceNow.
Have a look at advance glide scripts too.
With 9+ years of ITSM development experience,Chandrima likes to deep dive ServiceNow modules.She have extensively worked on PA,Service Portal,Event management.
Comments