get()
The get() method is an excellent shorthand for a very simple, single-condition query. It will only return one record. This method can accept either one or two arguments.
If one argument is supplied, it is expected that it'll be the sys_id of a record in the table specified when the GlideRecord object was instantiated.
If two arguments are specified, it is expected that the first argument will be a field name, and the second will be the value to filter by on that field. You cannot specify three arguments, which means it is not possible to use any special operators such as CONTAINS or >.
The get() method will only return one record, similar to using gr.setLimit(1);, or only calling gr.next(); once. Even if multiple records are returned ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access