From 6cd4cd003930da807440647d41fc4a0649bd5a8d Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:34:31 +0530 Subject: [PATCH 01/13] Create script.js --- Background scripts/script.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 Background scripts/script.js diff --git a/Background scripts/script.js b/Background scripts/script.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Background scripts/script.js @@ -0,0 +1 @@ + From dea746afbfa4ab042797614f8c59d03f0c131323 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:41:57 +0530 Subject: [PATCH 02/13] Delete Background scripts directory --- Background scripts/script.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Background scripts/script.js diff --git a/Background scripts/script.js b/Background scripts/script.js deleted file mode 100644 index 8b13789179..0000000000 --- a/Background scripts/script.js +++ /dev/null @@ -1 +0,0 @@ - From 0b8b632b726a4704c8d6619a26360b1bd2408c38 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:45:07 +0530 Subject: [PATCH 03/13] Create Convert comma separated values in string to columns --- .../Convert comma separated values in string to columns | 1 + 1 file changed, 1 insertion(+) create mode 100644 Useful-scripts/Convert comma separated values in string to columns diff --git a/Useful-scripts/Convert comma separated values in string to columns b/Useful-scripts/Convert comma separated values in string to columns new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Useful-scripts/Convert comma separated values in string to columns @@ -0,0 +1 @@ + From 3de4451138efcdaf00be703e88aa7af45ecc9fcb Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:54:26 +0530 Subject: [PATCH 04/13] Delete Convert comma separated values in string to columns --- .../Convert comma separated values in string to columns | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Useful-scripts/Convert comma separated values in string to columns diff --git a/Useful-scripts/Convert comma separated values in string to columns b/Useful-scripts/Convert comma separated values in string to columns deleted file mode 100644 index 8b13789179..0000000000 --- a/Useful-scripts/Convert comma separated values in string to columns +++ /dev/null @@ -1 +0,0 @@ - From b0fadf463ace47b2704558e92b8bc9078f864938 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:23:31 +0530 Subject: [PATCH 05/13] Create MID Server availability inside MID cluster.js --- .../MID Server availability inside MID cluster.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js new file mode 100644 index 0000000000..c14bd1f1cc --- /dev/null +++ b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js @@ -0,0 +1,10 @@ +var flag = 0; //initial flag to 0 + var glideCluster = new GlideRecord('ecc_agent_cluster_member_m2m'); //m2m table stores cluser and all the midserver relation + glideCluster.addQuery('cluster', "sys_id of the cluster"); //replace "sys_id of the cluster" with sys_id of the MID server cluster + glideCluster.query(); + while(glideCluster.next()){ + if(glideCluster.agent.status=='Up'){ + outputs.flag = 1; //if any one MID server is up proceed next step in the integration + break; + } + //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team From bd82bd4e19998ea1bc6c9c18af3892f8fa3cee1e Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:31:03 +0530 Subject: [PATCH 06/13] Create reame.md --- .../reame.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/reame.md diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md new file mode 100644 index 0000000000..1c0f688507 --- /dev/null +++ b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md @@ -0,0 +1,7 @@ +During integration set up with flow designers which involves MID servers , its better to check if MID server is up and running before we proceed with next steps in the integration. +when we are using MID Server cluster (where more than one MID server as a failover) its recommended to verify if atleast one MID server is up and establish the connect +MID server status inside cluster.js logic check if atleast one MID server is up if yes process next step in the integration if not abort the integration (we can have process to inform concered team) +example flow action : +where "inputs.midServerCluster.sys_id" is Cluster sys_id as input to the action +![image](https://github.com/gowdah/code-snippets/assets/42912180/59561199-3547-4ce2-a57e-d39ae65dbfcc) + From e6d6fd179fa2d17d25c7b051766f7b0cf6c51d3d Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:34:50 +0530 Subject: [PATCH 07/13] Update MID Server availability inside MID cluster.js --- .../MID Server availability inside MID cluster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js index c14bd1f1cc..304b03aeb1 100644 --- a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js +++ b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js @@ -7,4 +7,4 @@ var flag = 0; //initial flag to 0 outputs.flag = 1; //if any one MID server is up proceed next step in the integration break; } - //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team + //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team. From 4c241247b6f4e457bfe64796d031524936fb89b1 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:44:18 +0530 Subject: [PATCH 08/13] Delete Flow Actions/Check MID Servers status inside MID Server cluster directory --- .../MID Server availability inside MID cluster.js | 10 ---------- .../reame.md | 7 ------- 2 files changed, 17 deletions(-) delete mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js delete mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/reame.md diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js deleted file mode 100644 index 304b03aeb1..0000000000 --- a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js +++ /dev/null @@ -1,10 +0,0 @@ -var flag = 0; //initial flag to 0 - var glideCluster = new GlideRecord('ecc_agent_cluster_member_m2m'); //m2m table stores cluser and all the midserver relation - glideCluster.addQuery('cluster', "sys_id of the cluster"); //replace "sys_id of the cluster" with sys_id of the MID server cluster - glideCluster.query(); - while(glideCluster.next()){ - if(glideCluster.agent.status=='Up'){ - outputs.flag = 1; //if any one MID server is up proceed next step in the integration - break; - } - //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team. diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md deleted file mode 100644 index 1c0f688507..0000000000 --- a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md +++ /dev/null @@ -1,7 +0,0 @@ -During integration set up with flow designers which involves MID servers , its better to check if MID server is up and running before we proceed with next steps in the integration. -when we are using MID Server cluster (where more than one MID server as a failover) its recommended to verify if atleast one MID server is up and establish the connect -MID server status inside cluster.js logic check if atleast one MID server is up if yes process next step in the integration if not abort the integration (we can have process to inform concered team) -example flow action : -where "inputs.midServerCluster.sys_id" is Cluster sys_id as input to the action -![image](https://github.com/gowdah/code-snippets/assets/42912180/59561199-3547-4ce2-a57e-d39ae65dbfcc) - From d0905a8c278722d0c434f37b2782a1f1c4726818 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:14:29 +0530 Subject: [PATCH 09/13] Create UIscript.js --- .../UIscript.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js diff --git a/UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js b/UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js new file mode 100644 index 0000000000..2d7ce8d90e --- /dev/null +++ b/UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js @@ -0,0 +1,33 @@ + + + + + + + + From 6a3fbd37cf72fb56c4048126e0de1a26737f21a7 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:16:06 +0530 Subject: [PATCH 10/13] Create uiscript.js --- .../uiscript.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js diff --git a/UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js b/UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js new file mode 100644 index 0000000000..78b032bbab --- /dev/null +++ b/UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js @@ -0,0 +1,20 @@ +addLoadEvent(function() { + try { + // Skip contexts where GlideDialogWindow isn't available (e.g., Service Portal) + if (typeof GlideDialogWindow === 'undefined' || (window.NOW && NOW.sp)) + return; + var prefName = 'login.consent1'; + // Only show the dialog when the pref is explicitly 'false' + var val = (typeof getPreference === 'function') ? getPreference(prefName) : null; + var shouldShow = String(val || '').toLowerCase() === 'false'; + //alert("val"+" "+val+" "+"shouldShow"+" "+shouldShow); + if (!shouldShow) + return; + var dialog = new GlideDialogWindow('acknowledgement_dialog'); // UI Page name + dialog.setTitle('Acknowledge Message'); + dialog.setSize(500, 300); + dialog.render(); + } catch (e) { + if (console && console.warn) console.warn('ack loader error', e); + } +}); From c24dfc6fa195046f8ca4c392da1aa3855f1344e5 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:16:30 +0530 Subject: [PATCH 11/13] Rename UIscript.js to UIpage.js --- .../{UIscript.js => UIpage.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename UI Scripts/User acknowledgement Using UI script and user preferences/{UIscript.js => UIpage.js} (100%) diff --git a/UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js b/UI Scripts/User acknowledgement Using UI script and user preferences/UIpage.js similarity index 100% rename from UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js rename to UI Scripts/User acknowledgement Using UI script and user preferences/UIpage.js From 3e31616ce48a50681c78117b74eecb81f1f79467 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:16:48 +0530 Subject: [PATCH 12/13] Rename uiscript.js to UIscript.js --- .../{uiscript.js => UIscript.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename UI Scripts/User acknowledgement Using UI script and user preferences/{uiscript.js => UIscript.js} (100%) diff --git a/UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js b/UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js similarity index 100% rename from UI Scripts/User acknowledgement Using UI script and user preferences/uiscript.js rename to UI Scripts/User acknowledgement Using UI script and user preferences/UIscript.js From 5ce4201fee203fb82662dbf58ca27229c3f7eaf0 Mon Sep 17 00:00:00 2001 From: gowdah <42912180+gowdah@users.noreply.github.com> Date: Sat, 4 Oct 2025 22:35:02 +0530 Subject: [PATCH 13/13] Create readme.md --- .../readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 UI Scripts/User acknowledgement Using UI script and user preferences/readme.md diff --git a/UI Scripts/User acknowledgement Using UI script and user preferences/readme.md b/UI Scripts/User acknowledgement Using UI script and user preferences/readme.md new file mode 100644 index 0000000000..31f25a9232 --- /dev/null +++ b/UI Scripts/User acknowledgement Using UI script and user preferences/readme.md @@ -0,0 +1,15 @@ +**Create a user preference as follows:** +image +**Create a UI script:** +image +This script runs during login and checks the user preference. +If the preference is set to false, it displays the acknowledgement popup by calling UI page + +**UI Page details:** +image +Set the user preference to true so that the popup will not appear for every login. + +**Output**: +**On user login:** +image +