\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Bibin Gokuldas (bibingokuldas)} \pdfinfo{ /Title (key-api-servicenow-scripts.pdf) /Creator (Cheatography) /Author (Bibin Gokuldas (bibingokuldas)) /Subject (Key API ServiceNow Scripts Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{6B0000} \definecolor{LightBackground}{HTML}{FAF7F7} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Key API ServiceNow Scripts Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Bibin Gokuldas (bibingokuldas)} via \textcolor{DarkBackground}{\uline{cheatography.com/69673/cs/23998/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Bibin Gokuldas (bibingokuldas) \\ \uline{cheatography.com/bibingokuldas} \\ \uline{\seqsplit{bibingokuldas}.com/} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 24th August, 2020.\\ Updated 24th August, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ArrayUtil API}} \tn % Row 0 \SetRowColor{LightBackground} Merges two arrays & `new \seqsplit{ArrayUtil().concat(array1},array2)` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Searches the array for the element. Returns true if the element exists in the array, otherwise returns false & `new \seqsplit{ArrayUtil().contains(array},searchobject)` \tn % Row Count 8 (+ 6) % Row 2 \SetRowColor{LightBackground} Converts an object to an array. & `new \seqsplit{ArrayUtil().convertArray(Object)`} \tn % Row Count 10 (+ 2) % Row 3 \SetRowColor{white} Finds the differences between two or more arrays & `new \seqsplit{ArrayUtil().diff(array1},array2,array n)` \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} Returns an array from the object. & `new \seqsplit{ArrayUtil().ensureArray(Object)`} \tn % Row Count 15 (+ 2) % Row 5 \SetRowColor{white} Searches the array for the element. Returns the element index if found, -1 otherwise. & `new \seqsplit{ArrayUtil().indexOf(array1}, seachelement)` \tn % Row Count 20 (+ 5) % Row 6 \SetRowColor{LightBackground} Finds the elements common in all arrays. & `new \seqsplit{ArrayUtil().intersect(Array} a, Array b)` \tn % Row Count 23 (+ 3) % Row 7 \SetRowColor{white} Merges two or more arrays (common element is addded once) & `new \seqsplit{ArrayUtil().union(Array} a, Array b)` \tn % Row Count 26 (+ 3) % Row 8 \SetRowColor{LightBackground} Removes duplicate items from an array. & `new \seqsplit{ArrayUtil().unique(Array} a)` \tn % Row Count 28 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{The syntax of the above APIs can be Like this}} \newline \newline `var arUtil = new ArrayUtil();` \newline `arUtil.unique(array1);`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{CIUtils}} \tn % Row 0 \SetRowColor{LightBackground} Determine which business services are affected by a specific CI. & `new \seqsplit{CIUtils().servicesAffectedByCI(ci\_sys\_id);`} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Determine which business services are affected by a task. & `new \seqsplit{CIUtils().servicesAffectedByTask(taskgliderecord)`} \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{Sample Usage of the script can be like below}} \newline `var CIUtil = new CIUtils();` \newline `var bsaffected = \seqsplit{CIUtil.servicesAffectedByCI(ci\_sys\_id);`}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideFilter}} \tn % Row 0 \SetRowColor{LightBackground} Compares a specified filter to the contents of a specified GlideRecord. & \seqsplit{`GlideFilter.checkRecord(glideRecord}, "filterconditions",matchparameter);` \tn % Row Count 4 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{If the specified filter contains one condition, the method returns true if the record meets the condition of the filter.}} \newline {\emph{matchparameter indicates whether all conditions must be met if the filter parameter contains multiple conditions.}} \newline {\emph{Valid values:}} \newline {\emph{true: all conditions must be met for the method to return true}} \newline {\emph{false: only one of the conditions must be met for the method to return true.}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{TableUtils}} \tn % Row 0 \SetRowColor{LightBackground} Checks to see if a table exists. & `new \seqsplit{TableUtils("TABLENAME")}.tableExists();` \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Drops a database table. (use with caution) & `new \seqsplit{TableUtils().drop("TABLENAME");`} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} Drops a database table and cleans up references to the table. & `new \seqsplit{TableUtils().dropAndClean("TABLENAME");`} \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} Drops a database table, all of it's extended tables, and cleans up references to the tables. & `new \seqsplit{TableUtils().dropTableAndExtensions("TABLENAME");`} \tn % Row Count 15 (+ 5) % Row 4 \SetRowColor{LightBackground} Returns the base table name from which the table was extended. & `new \seqsplit{TableUtils("tablename")}.getAbsoluteBase();` \tn % Row Count 19 (+ 4) % Row 5 \SetRowColor{white} Returns the list of tables that extend a table, includes the base table in array & `new \seqsplit{TableUtils("tablename")}.getAllExtensions();` \tn % Row Count 23 (+ 4) % Row 6 \SetRowColor{LightBackground} Returns a list of all classes participating in the hierarchy of the specified table. & `new \seqsplit{TableUtils("tablename")}.getHierarchy();` \tn % Row Count 28 (+ 5) % Row 7 \SetRowColor{white} Returns the table hierarchy. & `new \seqsplit{TableUtils("tablename")}.getTables();` \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{TableUtils (cont)}} \tn % Row 8 \SetRowColor{LightBackground} Returnss a list of tables that extend a table. & `new \seqsplit{TableUtils("tablename")}.getTableExtensions();` \tn % Row Count 3 (+ 3) % Row 9 \SetRowColor{white} Determines if a table has been extended. & `new \seqsplit{TableUtils("tablename")}.hasExtensions();` \tn % Row Count 6 (+ 3) % Row 10 \SetRowColor{LightBackground} Determines if a table is a base class, meaning it has no parents and has extensions. & `new \seqsplit{TableUtils("tablename")}.isBaseClass();` \tn % Row Count 11 (+ 5) % Row 11 \SetRowColor{white} Determines if the table has no parents and no extensions. & `new \seqsplit{TableUtils("tablename")}.isSoloClass();` \tn % Row Count 14 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{Use Drop the table function with extreme caution as it will delete the table and the data forever}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideSysAttachment}} \tn % Row 0 \SetRowColor{LightBackground} Copies attachments from the source record to the target record. & `new \seqsplit{GlideSysAttachment()}.copy(String sourceTable, String sourceID, String targetTable, String targetID)` \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} Deletes the specified attachment. & `new \seqsplit{GlideSysAttachment()}.deleteAttachment(attachmentsysID)` \tn % Row Count 9 (+ 3) % Row 2 \SetRowColor{LightBackground} Returns a GlideRecord containing the matching attachment metadata such as name, type, or size. & `new \seqsplit{GlideSysAttachment()}.getAttachments('\textless{}table\_name\textgreater{}', '\textless{}record\_sys\_id\textgreater{}');` \tn % Row Count 14 (+ 5) % Row 3 \SetRowColor{white} Returns the attachment content as a string. & `new \seqsplit{GlideSysAttachment()}.getContent(GlideRecord sysAttachment)` \tn % Row Count 18 (+ 4) % Row 4 \SetRowColor{LightBackground} Returns the attachment content as a string with base64 encoding. & `new \seqsplit{GlideSysAttachment()}.getContentBase64( GlideRecord sysAttachment)` \tn % Row Count 22 (+ 4) % Row 5 \SetRowColor{white} Inserts an attachment for the specified record using base64 encoded content. & `new \seqsplit{GlideSysAttachment()}.writeBase64( GlideRecord gr, String fileName, String contentType, String \seqsplit{content\_base64Encoded)`} \tn % Row Count 29 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{SLARepair}} \tn % Row 0 \SetRowColor{LightBackground} Repair the task SLAs associated with the passed-in filter and source table. & `new \seqsplit{SLARepair().repairByFilter('filter'}, 'tablename');` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Repair the task SLAs associated with the passed in GlideRecord. & `new \seqsplit{SLARepair().repairByGlideRecord(glideRecord)`} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} Repair the task SLAs associated with the passed in sys\_id and source table. & `new \seqsplit{SLARepair().repairBySysId('sysId'}, 'tablename');` \tn % Row Count 12 (+ 4) % Row 3 \SetRowColor{white} Enables or disables auditing when running a repair.* & `new \seqsplit{SLARepair().setAuditEnabled(true);`} \tn % Row Count 15 (+ 3) % Row 4 \SetRowColor{LightBackground} Enables or disables running a workflow for each of the Task SLA records being repaired. & `new \seqsplit{SLARepair().setRunWorkflow(false)`} \tn % Row Count 20 (+ 5) % Row 5 \SetRowColor{white} Validates the repair request. & `new \seqsplit{SLARepair().setValidateOnly(true);`} \tn % Row Count 22 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{The SLARepair API first deletes the existing SLAs and then recreates them from each task's history.}} \newline {\emph{*auditing is set to the value in the property \seqsplit{com.snc.sla.repair.audit.} You can override this with passing in true to enable or false to disable auditing.}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideEmailOutbound}} \tn % Row 0 \SetRowColor{LightBackground} Adds the address to either the cc or bcc list. & \seqsplit{`email.addAddress('cc/bcc'}, 'emailaddress1','emailaddress2');` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Returns the email's subject line. & \seqsplit{`email.getSubject()`} \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} Returns the email's watermark. & \seqsplit{`email.getWatermark()`} \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} Sets the body of the email. & \seqsplit{`email.setBody('bodytext');`} \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} Sets the sender's address. & \seqsplit{`email.setFrom('emailaddress');} \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} Sets the reply to address. & \seqsplit{`email.setReplyTo('emailaddress');`} \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} Sets the email's subject line. & \seqsplit{`email.setSubject('emailaddress');`} \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideSession}} \tn % Row 0 \SetRowColor{LightBackground} Sets a session client value that can be retrieved with getClientData(). & \seqsplit{`gs.getSession().putClientData('paramname'}, 'paramvalue');` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Determines if the current user is currently logged in. & \seqsplit{'gs.getSession().isLoggedIn()'} \tn % Row Count 7 (+ 3) % Row 2 \SetRowColor{LightBackground} Determines if the current session is interactive. & \seqsplit{'gs.getSession().isInteractive()'} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} Gets the name of the session's time zone. & \seqsplit{'gs.getSession().getTimeZoneName()'} \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} Gets a list of roles for the current user. & \seqsplit{'gs.getSession().getRoles()'} \tn % Row Count 16 (+ 3) % Row 5 \SetRowColor{white} Gets the session's language code. & \seqsplit{'gs.getSession().getLanguage()'} \tn % Row Count 18 (+ 2) % Row 6 \SetRowColor{LightBackground} Returns a session client value previously set with putClientData(). & \seqsplit{`gs.getSession().getClientData('paramname');`} \tn % Row Count 22 (+ 4) % Row 7 \SetRowColor{white} Clears a session client value previously set with putClientData(). & \seqsplit{`gs.getSession().clearClientData('paramname');`} \tn % Row Count 26 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{The GlideSession API allows you to find information about the current session.}} \newline `var session = gs.getSession();` \newline `session.putClientData('cheatsheet', 'OOBAPI');`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{CartJS}} \tn % Row 0 \SetRowColor{LightBackground} Adds the request for a catalog item to the current cart. & `new \seqsplit{sn\_sc.CartJS().addToCart(request);`} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Performs the cart checkout. If the two-step checkout is enabled, returns the order summary. If the two-step checkout is disabled, the cart is submitted and details of the generated request are returned. & `new \seqsplit{sn\_sc.CartJS().checkoutCart();`} \tn % Row Count 14 (+ 11) % Row 2 \SetRowColor{LightBackground} Deletes the current cart. & `new \seqsplit{sn\_sc.CartJS().empty();`} \tn % Row Count 16 (+ 2) % Row 3 \SetRowColor{white} Returns the cart id of the current cart. & `new \seqsplit{sn\_sc.CartJS().getCartID();`} \tn % Row Count 18 (+ 2) % Row 4 \SetRowColor{LightBackground} Returns the GlideRecord for the cart item (sc\_cart\_item) in the current cart. & `new \seqsplit{sn\_sc.CartJS().getCartItems();`} \tn % Row Count 22 (+ 4) % Row 5 \SetRowColor{white} Gets the sys\_id from the sys\_user record of the user for whom the cart is requested. & `new \seqsplit{sn\_sc.CartJS().getRequestedFor();`} \tn % Row Count 27 (+ 5) % Row 6 \SetRowColor{LightBackground} Orders a single item. & `new \seqsplit{sn\_sc.CartJS().orderNow(request);`} \tn % Row Count 29 (+ 2) % Row 7 \SetRowColor{white} Specifies if the current user has the required role to edit the Request for field. & `new \seqsplit{sn\_sc.CartJS().canViewRF();`} \tn % Row Count 34 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{CartJS (cont)}} \tn % Row 8 \SetRowColor{LightBackground} Sets the sys\_id in the sys\_user record of the user for whom the cart is requested. & `new \seqsplit{sn\_sc.CartJS().setRequestedFor(sysid)`} \tn % Row Count 5 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{The variable used in the scripts above called 'request' should be a JSON Object which has the details of the catalog items to be added to cart or to order. Sample is below}} \newline `var item =\{` \newline `'sysparm\_id': \seqsplit{'0d08837237153000158bbfc8bcbe5d02'}, // Catalog item sys\_id` \newline `'sysparm\_quantity': '1',` \newline `'variables':\{ // Pass the catalog item variables` \newline `'carrier': 'at\_and\_t\_mobility',` \newline `'data\_plan': '500MB',` \newline `'duration': 'eighteen\_months',` \newline `'color': 'slate',` \newline `'storage': 'sixtyfour' ` \newline `\}\};`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{TemplatePrinter (Mail Script)}} \tn % Row 0 \SetRowColor{LightBackground} Prints the string to the email body. & \seqsplit{`template.print("Incident} number - " + current.number + "\textbackslash{}n");` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Adds non-breaking spaces to the email body. & \seqsplit{`template.space(4);`} \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideLocale}} \tn % Row 0 \SetRowColor{LightBackground} Returns the GlideLocale object. & `GlideLocale.get()` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Returns the decimal separator. & `var locale = GlideLocale.get(); var dseperatr = \seqsplit{locate.getDecimalSeparator()`} \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} Returns the grouping separator. & `var locale = GlideLocale.get();var groupingSeparator = \seqsplit{locale.getGroupingSeparator();`} \tn % Row Count 10 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideRecordUtil}} \tn % Row 0 \SetRowColor{LightBackground} Returns a GlideRecord instance positioned to the given CI sys\_id, and of the right class (table). & `new \seqsplit{GlideRecordUtil().getCIGR("cisysid");`} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} Returns a list of all the fields in the specified GlideRecord. & `new \seqsplit{GlideRecordUtil().getFields(gliderecordobject)`} \tn % Row Count 9 (+ 4) % Row 2 \SetRowColor{LightBackground} Returns a GlideRecord instance for the given table, positioned to the given sys\_id, and of the right class (table). & `new \seqsplit{GlideRecordUtil().getGR("table"}, "sysID");` \tn % Row Count 15 (+ 6) % Row 3 \SetRowColor{white} Returns a Java ArrayList of the ancestors of the given table name. & `new \seqsplit{GlideRecordUtil().getTables("tablename")`} \tn % Row Count 19 (+ 4) % Row 4 \SetRowColor{LightBackground} Sets the fields in the specified GlideRecord with the field values contained in the specified hashmap, unless that field name is in the ignore hashmap.* & `var gr = new \seqsplit{GlideRecordUtil().getGR("table"}, "sysid"); var obj = \{"fieldname": "fieldvalue"\}; var ignore = \{"sys\_created\_by": true\}; new \seqsplit{GlideRecordUtil().mergeToGR(obj}, gr, ignore); gr.update();` \tn % Row Count 30 (+ 11) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideRecordUtil (cont)}} \tn % Row 5 \SetRowColor{LightBackground} Populates the given hashmap from the given GlideRecord instance. Each field in the GlideRecord becomes a property in the hashmap.{\emph{( returns field/value pairs from the GlideRecord)}} & `var objectToPopulate = \{\}; var gr = new \seqsplit{GlideRecordUtil().getGR("table"}, "sysid"); var ignore = \{"sys\_created\_on": true, "sys\_updated\_by": true\}; new \seqsplit{GlideRecordUtil().populateFromGR(objectToPopulate}, gr, ignore);` \tn % Row Count 11 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{GlideSchedule}} \tn % Row 0 \SetRowColor{LightBackground} Adds a new schedule segment to the current schedule. & `new \seqsplit{GlideSchedule().add(startDate}, duration)` \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Determines the elapsed time in the schedule between two date time values using the timezone of the schedule or, if that is not specified, the timezone of the session. & `var schedule = new \seqsplit{GlideSchedule();schedule}.load('schedulesysid');var duration = \seqsplit{schedule.duration(startDate}, endDate);` \tn % Row Count 12 (+ 9) % Row 2 \SetRowColor{LightBackground} Retrieves the schedule name. & `new \seqsplit{GlideSchedule(sys\_id)}.getName()` \tn % Row Count 14 (+ 2) % Row 3 \SetRowColor{white} Determines if the given datetime is within the current schedule. & ` new \seqsplit{GlideSchedule("schedulesysid")}.isInSchedule(date);` \tn % Row Count 18 (+ 4) % Row 4 \SetRowColor{LightBackground} Determines if the current schedule is valid. A schedule is valid if it has at least one schedule span. & ` new \seqsplit{GlideSchedule("schedulesysid")}.isValid();` \tn % Row Count 24 (+ 6) % Row 5 \SetRowColor{white} Sets the timezone for the current schedule. & `var schedule = new GlideSchedule(); \seqsplit{schedule.setTimeZone('US/Pacific');`} \tn % Row Count 28 (+ 4) % Row 6 \SetRowColor{LightBackground} Determines how much time (in milliseconds) until start time of the next schedule item. & `new \seqsplit{GlideSchedule('schedulesysID'}, \seqsplit{'timezone').whenNext(startDate)`} \tn % Row Count 33 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{The scoped GlideSchedule API provides methods for performing operations on GlideSchedule objects, such as adding new schedule segments to a schedule, determining if a datetime is within the schedule, or setting the schedule timezone.}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{FlowAPI}} \tn % Row 0 \SetRowColor{LightBackground} Cancels a paused or running flow, subflow, or action. & \seqsplit{`sn\_fd.FlowAPI.startFlow('flowname'}, inputs); ` \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Run an action from a server-side script synchronously. & \seqsplit{`sn\_fd.FlowAPI.executeAction('flowname'}, inputs);` \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} Run an action from a server-side script synchronously from the current user session without creating execution details or other related records & \seqsplit{`sn\_fd.FlowAPI.executeActionQuick('flowname'}, inputs);` \tn % Row Count 14 (+ 8) % Row 3 \SetRowColor{white} Runs a Data Stream action synchronously from a server-side script and returns a \seqsplit{ScriptableDataStream} object. & \seqsplit{`sn\_fd.FlowAPI.executeDataStreamAction('datastream\_name'},input,timeout);` \tn % Row Count 20 (+ 6) % Row 4 \SetRowColor{LightBackground} Run a flow from a server-side script synchronously. & \seqsplit{`sn\_fd.FlowAPI.executeFlow('flowname'}, inputs,timeout);` \tn % Row Count 23 (+ 3) % Row 5 \SetRowColor{white} Run a flow, subflow, or action from a server-side script synchronously or asynchronously without creating execution details or other related records. & \seqsplit{`sn\_fd.FlowAPI.executeFlowQuick('flowname'}, inputs);` \tn % Row Count 31 (+ 8) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{FlowAPI (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Run an subflow from a server-side script synchronously. & `var results = \seqsplit{sn\_fd.FlowAPI.executeSubflow('flowname'}, inputs);` \tn % Row Count 4 (+ 4) % Row 7 \SetRowColor{white} Run a subflow from a server-side script synchronously from the current user session without creating execution details or other related records & `var results = \seqsplit{sn\_fd.FlowAPI.executeSubflowQuick('flowname'}, inputs);` \tn % Row Count 12 (+ 8) % Row 8 \SetRowColor{LightBackground} Build password2 values inside a script step. & `var \seqsplit{encrypteddata=sn\_fd}.GlideActionUtil.setEncryptedOutput(Val);` \tn % Row Count 16 (+ 4) % Row 9 \SetRowColor{white} Run an action from a server-side script asynchronously. & \seqsplit{`sn\_fd.FlowAPI.startAction('flowname'}, inputs); ` \tn % Row Count 19 (+ 3) % Row 10 \SetRowColor{LightBackground} Run an action from a server-side script asynchronously without creating execution details & \seqsplit{`sn\_fd.FlowAPI.startActionQuick('flowname'}, inputs); ` \tn % Row Count 24 (+ 5) % Row 11 \SetRowColor{white} Run a flow from a server-side script. & \seqsplit{`sn\_fd.FlowAPI.startFlow('flowname'}, inputs); ` \tn % Row Count 27 (+ 3) % Row 12 \SetRowColor{LightBackground} Run a flow from a server-side script asynchronously without creating execution details & \seqsplit{`sn\_fd.FlowAPI.startFlowQuick('flowname'}, inputs); ` \tn % Row Count 32 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{FlowAPI (cont)}} \tn % Row 13 \SetRowColor{LightBackground} Run a subflow from a server-side script. & \seqsplit{`sn\_fd.FlowAPI.startSubflow('flowname'}, inputs);` \tn % Row Count 3 (+ 3) % Row 14 \SetRowColor{white} Run a subflow from a server-side script asynchronously without creating execution details & \seqsplit{`sn\_fd.FlowAPI.startSubflowQuick('flowname'}, inputs);` \tn % Row Count 8 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\emph{Use FlowAPI methods to execute actions, flows, or subflows in server-side scripts using either blocking or non-blocking methods.}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}