diff --git a/GlideRecord/Display list of records based on Users Location/Readme.md b/GlideRecord/Display list of records based on Users Location/Readme.md new file mode 100644 index 0000000000..dd80b0b01c --- /dev/null +++ b/GlideRecord/Display list of records based on Users Location/Readme.md @@ -0,0 +1 @@ +Get the list of records based on the User's Location while getting the list of records diff --git a/GlideRecord/Display list of records based on Users Location/listOfRecordsBasedOnLocation.js b/GlideRecord/Display list of records based on Users Location/listOfRecordsBasedOnLocation.js new file mode 100644 index 0000000000..3221ef869d --- /dev/null +++ b/GlideRecord/Display list of records based on Users Location/listOfRecordsBasedOnLocation.js @@ -0,0 +1,19 @@ +// Business Rule to display the list of records based on the user's location + +When to Run - Before Query +Table - Any table in which you want to perform this script +Scripts - +(function executeRule(current, previous /*null when async*/ ) { + + // Add your code here + var current_user = gs.getUserID(); + + var usr = new GlideRecord('sys_user'); // Query User Table + usr.addQuery('sys_id', current_user); + usr.query(); + if (usr.next()) { + if (usr.location != '') { + current.addQuery('location=' + usr.location); // Querying the user's location with current record location + } + } +})(current, previous); diff --git a/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/README.md b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/README.md new file mode 100644 index 0000000000..0716005b78 --- /dev/null +++ b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/README.md @@ -0,0 +1,2 @@ +This script basically updates the Description in Incident table which includes some text but added telephone icon using the script, so that it looks fascinating. +This includes screenshot as well where it shows telephone icon concatenated with specific meaningful string. diff --git a/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/Screenshot.png b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/Screenshot.png new file mode 100644 index 0000000000..1a033fd6af Binary files /dev/null and b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/Screenshot.png differ diff --git a/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/code_snippet.js b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/code_snippet.js new file mode 100644 index 0000000000..7a13ace7fc --- /dev/null +++ b/Server-Side Components/Business Rules/Update Description with Telephone icon added with meaningful description statement/code_snippet.js @@ -0,0 +1,15 @@ +// Update description with telephone icon with specific meaningful description concatenated +(function executeRule(current, previous /*null when async*/) { + + try { + //code to execute goes here + var myTelephone = "\u260E"; // Create the telephone icon + if (current.description == "") { + current.setValue('description', "You really should " + myTelephone + " home more often."); // Update the description in concatenation with telephone icon script + } + } catch (err) { + //code to handle error goes here + gs.error("A runtime error has occurred: " + err); + } + +})(current, previous);