From 96a196e35ec9c9a09b2a1d94100dd0cb494e6969 Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Sun, 13 Oct 2024 19:54:28 +0530 Subject: [PATCH 1/8] Create Open in LIST View --- UI Actions/Open in LIST View | 1 + 1 file changed, 1 insertion(+) create mode 100644 UI Actions/Open in LIST View diff --git a/UI Actions/Open in LIST View b/UI Actions/Open in LIST View new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/UI Actions/Open in LIST View @@ -0,0 +1 @@ + From 546ef1c924029d7c76df3914c6bc8fff3c2f2f40 Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Sun, 13 Oct 2024 19:54:59 +0530 Subject: [PATCH 2/8] Delete UI Actions/Open in LIST View --- UI Actions/Open in LIST View | 1 - 1 file changed, 1 deletion(-) delete mode 100644 UI Actions/Open in LIST View diff --git a/UI Actions/Open in LIST View b/UI Actions/Open in LIST View deleted file mode 100644 index 8b13789179..0000000000 --- a/UI Actions/Open in LIST View +++ /dev/null @@ -1 +0,0 @@ - From 53e71973f407eabe92b1d934b0ba2e18b895e38a Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:27:26 +0530 Subject: [PATCH 3/8] Add files via upload UI Action for Opening the LIST view of current Form Table --- UI Actions/Open LIST.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 UI Actions/Open LIST.js diff --git a/UI Actions/Open LIST.js b/UI Actions/Open LIST.js new file mode 100644 index 0000000000..2fdab16a17 --- /dev/null +++ b/UI Actions/Open LIST.js @@ -0,0 +1,10 @@ +function openinLIST() { + var taskTable = g_form.getTableName(); + + // Construct the hardcoded LIST URL + var listURL = '/' + taskTable + '_list.do?sysparm_clear_stack=true'; + + // Open in new window + var w = getTopWindow(); + w.window.open(listURL, '_blank'); +} \ No newline at end of file From c2cfa145747762232586fc0425cad12f396978cd Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Mon, 14 Oct 2024 01:13:58 +0530 Subject: [PATCH 4/8] Delete UI Actions/Open LIST.js --- UI Actions/Open LIST.js | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 UI Actions/Open LIST.js diff --git a/UI Actions/Open LIST.js b/UI Actions/Open LIST.js deleted file mode 100644 index 2fdab16a17..0000000000 --- a/UI Actions/Open LIST.js +++ /dev/null @@ -1,10 +0,0 @@ -function openinLIST() { - var taskTable = g_form.getTableName(); - - // Construct the hardcoded LIST URL - var listURL = '/' + taskTable + '_list.do?sysparm_clear_stack=true'; - - // Open in new window - var w = getTopWindow(); - w.window.open(listURL, '_blank'); -} \ No newline at end of file From 9ad52c665cc3f402ea2fee29cb5fa00bdaa0ef83 Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Mon, 14 Oct 2024 01:17:09 +0530 Subject: [PATCH 5/8] Create UIActionscript.js --- UI Actions/Open LIST UI Action/UIActionscript.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 UI Actions/Open LIST UI Action/UIActionscript.js diff --git a/UI Actions/Open LIST UI Action/UIActionscript.js b/UI Actions/Open LIST UI Action/UIActionscript.js new file mode 100644 index 0000000000..735b6f2999 --- /dev/null +++ b/UI Actions/Open LIST UI Action/UIActionscript.js @@ -0,0 +1,10 @@ +function openinLIST() { + var taskTable = g_form.getTableName(); + + // Construct the hardcoded LIST URL + var listURL = '/' + taskTable + '_list.do?sysparm_clear_stack=true'; + + // Open in new window + var w = getTopWindow(); + w.window.open(listURL, '_blank'); +} From 11d720a3a043d448f7071dbe7d36ebeb8231b57a Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Mon, 14 Oct 2024 01:17:57 +0530 Subject: [PATCH 6/8] readme.md Open LIST UI Action --- UI Actions/Open LIST UI Action/readme.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 UI Actions/Open LIST UI Action/readme.md diff --git a/UI Actions/Open LIST UI Action/readme.md b/UI Actions/Open LIST UI Action/readme.md new file mode 100644 index 0000000000..4ba977379e --- /dev/null +++ b/UI Actions/Open LIST UI Action/readme.md @@ -0,0 +1,2 @@ +This UI Action opens the LIST view for the current table in another tab. +UI action will run on Onclick openinLIST() From 6a6733e4c287f3d78d4d03a64f51d732c7f0f881 Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Sat, 26 Oct 2024 23:25:57 +0530 Subject: [PATCH 7/8] Create getRecordXML.js --- .../Get XML Of a Record/getRecordXML.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Background Scripts/Get XML Of a Record/getRecordXML.js diff --git a/Background Scripts/Get XML Of a Record/getRecordXML.js b/Background Scripts/Get XML Of a Record/getRecordXML.js new file mode 100644 index 0000000000..5c7e99845e --- /dev/null +++ b/Background Scripts/Get XML Of a Record/getRecordXML.js @@ -0,0 +1,22 @@ +function getRecordXML(tableName, sysId) { + var gr = new GlideRecord(tableName); // Replace 'incident' with your table name + gr.get(sysId); + var xmlDoc = new XMLDocument(); + var baseTag = xmlDoc.createElement('incident'); + var fields = gr.getFields(); + + var fieldNames = []; + for (var i = 0; i < fields.size(); i++) { + fieldNames.push(fields.get(i).getName()); + } + fieldNames.sort(); + + fieldNames.forEach(function(fieldName) { + var fieldValue = gr.getValue(fieldName); + var fieldTag = xmlDoc.createElement(fieldName); + fieldTag.setTextContent(fieldValue); + baseTag.appendChild(fieldTag); + }); + gs.info(xmlDoc.toString()); + return xmlDoc.toString(); +} From 7bd0d1f94ee3a5532f95136ac572a0b9d67a54ea Mon Sep 17 00:00:00 2001 From: prithvibalakka <110714879+prithvibalakka@users.noreply.github.com> Date: Sat, 26 Oct 2024 23:26:29 +0530 Subject: [PATCH 8/8] Create readme.md --- Background Scripts/Get XML Of a Record/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Background Scripts/Get XML Of a Record/readme.md diff --git a/Background Scripts/Get XML Of a Record/readme.md b/Background Scripts/Get XML Of a Record/readme.md new file mode 100644 index 0000000000..db182d2470 --- /dev/null +++ b/Background Scripts/Get XML Of a Record/readme.md @@ -0,0 +1 @@ +This function, getRecordXML, is a custom JavaScript function designed for ServiceNow to generate an XML representation of a record in any specified table.