User Tools

Site Tools


buttons

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
buttons [2025/11/24 04:23] – created johnsonjohnbuttons [2025/11/24 05:43] (current) johnsonjohn
Line 1: Line 1:
 =====Buttons===== =====Buttons=====
-===List Button===+====List Button====
 <code javascript listButton.js>(function(){var myURL = window.location.href;myURL = decodeURIComponent(myURL);if ( myURL.indexOf("service-now.com/") < 0 && myURL.indexOf('wwwsnow') < 0 ){alert("Looks like you are not on a ServiceNow page.");return;}if ( myURL.indexOf("_list.do") > 0){alert("Looks like you are already in a List View, not a Form.");return;}var indexOfColonSlashSlash = myURL.indexOf("://");var indexOfFunctionPath = myURL.indexOf("/", indexOfColonSlashSlash + 3) + 1;var domainPath;var remainder;var table;var indexOfSysId;var indexOfDotDo;var indexOfDotDoTwo;domainPath = myURL.slice(0, indexOfFunctionPath);remainder = myURL.slice(indexOfFunctionPath);indexOfDotDo = remainder.indexOf(".do?%22);table%20=%20remainder.slice(0,%20indexOfDotDo);if%20(table%20==%20%22nav_to%22){indexOfURI%20=%20remainder.indexOf(%22uri=%22);indexOfDotDoTwo%20=%20remainder.indexOf(%22.do%22,%20indexOfURI);table%20=%20remainder.slice(indexOfURI%20+%205,%20indexOfDotDoTwo);}indexOfSysId%20=%20remainder.indexOf(%22sys_id=%22)%20+%207;indexOfCharAfterSysId%20=%20remainder.indexOf(%22&%22,%20indexOfSysId);if%20(indexOfCharAfterSysId%20==%20-1){sysId%20=%20remainder.slice(indexOfSysId);}else{sysId%20=%20remainder.slice(indexOfSysId,%20indexOfCharAfterSysId);}var%20navToDoPrefix%20=%20%22nav_to.do?uri=/%22;var%20listSuffixAndQueryPrefix%20=%20%22_list.do?sysparm_query=sys_id=%22;var%20completeNewPath%20=%20domainPath%20+%20navToDoPrefix%20+%20table%20+%20listSuffixAndQueryPrefix%20+%20sysId;window.location.href%20=%20completeNewPath;})(); <code javascript listButton.js>(function(){var myURL = window.location.href;myURL = decodeURIComponent(myURL);if ( myURL.indexOf("service-now.com/") < 0 && myURL.indexOf('wwwsnow') < 0 ){alert("Looks like you are not on a ServiceNow page.");return;}if ( myURL.indexOf("_list.do") > 0){alert("Looks like you are already in a List View, not a Form.");return;}var indexOfColonSlashSlash = myURL.indexOf("://");var indexOfFunctionPath = myURL.indexOf("/", indexOfColonSlashSlash + 3) + 1;var domainPath;var remainder;var table;var indexOfSysId;var indexOfDotDo;var indexOfDotDoTwo;domainPath = myURL.slice(0, indexOfFunctionPath);remainder = myURL.slice(indexOfFunctionPath);indexOfDotDo = remainder.indexOf(".do?%22);table%20=%20remainder.slice(0,%20indexOfDotDo);if%20(table%20==%20%22nav_to%22){indexOfURI%20=%20remainder.indexOf(%22uri=%22);indexOfDotDoTwo%20=%20remainder.indexOf(%22.do%22,%20indexOfURI);table%20=%20remainder.slice(indexOfURI%20+%205,%20indexOfDotDoTwo);}indexOfSysId%20=%20remainder.indexOf(%22sys_id=%22)%20+%207;indexOfCharAfterSysId%20=%20remainder.indexOf(%22&%22,%20indexOfSysId);if%20(indexOfCharAfterSysId%20==%20-1){sysId%20=%20remainder.slice(indexOfSysId);}else{sysId%20=%20remainder.slice(indexOfSysId,%20indexOfCharAfterSysId);}var%20navToDoPrefix%20=%20%22nav_to.do?uri=/%22;var%20listSuffixAndQueryPrefix%20=%20%22_list.do?sysparm_query=sys_id=%22;var%20completeNewPath%20=%20domainPath%20+%20navToDoPrefix%20+%20table%20+%20listSuffixAndQueryPrefix%20+%20sysId;window.location.href%20=%20completeNewPath;})();
 </code> </code>
  
-===Frame Button===+====Frame Button====
 <code javascript frameButton.js>(function(){var a=window.location.href; if(0<=a.indexOf("navpage.do") ||0<=a.indexOf("nav_to.do") ||0<=a.indexOf("workflow_ide.do")) alert("Looks like you're already inside a frame!"); else if(0<=a.indexOf("service-now.com/") || 0 <= a.indexOf('wwwsnow')){var b=a.indexOf("://"),b=a.indexOf("/",b+3)+1,c=a.slice(0,b),a=a.slice(b);window.location.href=c+"nav_to.do?uri=%22+a}%20else%20alert(%22That%20only%20works%20on%20ServiceNow%20pages.%22)})();</code> <code javascript frameButton.js>(function(){var a=window.location.href; if(0<=a.indexOf("navpage.do") ||0<=a.indexOf("nav_to.do") ||0<=a.indexOf("workflow_ide.do")) alert("Looks like you're already inside a frame!"); else if(0<=a.indexOf("service-now.com/") || 0 <= a.indexOf('wwwsnow')){var b=a.indexOf("://"),b=a.indexOf("/",b+3)+1,c=a.slice(0,b),a=a.slice(b);window.location.href=c+"nav_to.do?uri=%22+a}%20else%20alert(%22That%20only%20works%20on%20ServiceNow%20pages.%22)})();</code>
  
-===Latest Docs Button===+====Latest Docs Button====
 <code javascript latestDocs.js>(function(){var a=location.href;if(a.toString().includes('docs.servicenow.com')){var b=a.indexOf('/concept/')+9;var c=a.indexOf('.html',b)+5;a='https://docs.servicenow.com/csh?topicname=%27+a.substring(b,c)+%27&version=latest%27;navigator.clipboard.writeText(a);alert(%27Latest%20page%20URL%20copied%20to%20clipboard.\nNavigating%20to%20latest%20page%20version.%27);location.href=a}else%20alert(%27This%20does%20not%20appear%20to%20be%20a%20ServiceNow%20Docs%20page.%20This%20button%20only%20works%20for%20pages%20on%20docs.servicenow.com.%27)})();</code> <code javascript latestDocs.js>(function(){var a=location.href;if(a.toString().includes('docs.servicenow.com')){var b=a.indexOf('/concept/')+9;var c=a.indexOf('.html',b)+5;a='https://docs.servicenow.com/csh?topicname=%27+a.substring(b,c)+%27&version=latest%27;navigator.clipboard.writeText(a);alert(%27Latest%20page%20URL%20copied%20to%20clipboard.\nNavigating%20to%20latest%20page%20version.%27);location.href=a}else%20alert(%27This%20does%20not%20appear%20to%20be%20a%20ServiceNow%20Docs%20page.%20This%20button%20only%20works%20for%20pages%20on%20docs.servicenow.com.%27)})();</code>
  
-===Debug Now Button===+====Debug Now Button====
 Key Concept - Server - 'Set Redirect URL' Function Key Concept - Server - 'Set Redirect URL' Function
 - Use the Debug Now UI Action to debug scripts from table sysauto_script ("Scheduled Script Executions") with syntax highlighting and breakpoint capabilities. - Use the Debug Now UI Action to debug scripts from table sysauto_script ("Scheduled Script Executions") with syntax highlighting and breakpoint capabilities.
Line 34: Line 34:
 </code> </code>
  
-===Assign To Me Button=== +====Assign To Me Button====
 <code javascript assignToMe.js> <code javascript assignToMe.js>
 //Credit to: https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/ //Credit to: https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
buttons.1763987017.txt.gz · Last modified: by johnsonjohn

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki