User Tools

Site Tools


misc

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
misc [01/22/2025 08:43] johnsonjohnmisc [01/22/2025 08:49] (current) johnsonjohn
Line 1: Line 1:
 ======Miscellaneous====== ======Miscellaneous======
 +----
 +
 +=====Multiple GETs=====
 +<code>
 +//Get Current Role
 +gs.hasRole('itil');
 +
 +//Get Current User
 +javascript:gs.getUserID();
 +gs.getUser().getUserByID(current.approver).hasRole('itil');
 +
 +//Get Instance Name
 +gs.getProperty("instance_name");
 +
 +//Get Instance URL
 +gs.getProperty('glide.servlet.uri')
 +
 +
 +</code>
 ---- ----
  
Line 94: Line 113:
  
                                                 OutputToAll("SYS_ID: " + sys_id);                                                 OutputToAll("SYS_ID: " + sys_id);
- 
                                                 OutputToForm(listViewHTML);                                                 OutputToForm(listViewHTML);
- 
                                                 OutputToForm(directLinkHTML);                                                 OutputToForm(directLinkHTML);
- 
                                                 OutputToLog("List View: " + listViewURL);                                                 OutputToLog("List View: " + listViewURL);
- 
                                                 OutputToLog("Form View: " + formViewURL);                                                 OutputToLog("Form View: " + formViewURL);
- +                                       
-                                                +
                                                 //We found what we came for.  No need to keep searching.                                                 //We found what we came for.  No need to keep searching.
- 
                                                 break;                                                 break;
  
Line 112: Line 124:
  
                 }                 }
- 
-  
- 
                 if (! recordFound){                 if (! recordFound){
  
                                 OutputToAll("sys_id " + sys_id + " could not be found in any of the tables searched.");                                 OutputToAll("sys_id " + sys_id + " could not be found in any of the tables searched.");
- +                             
-                } +
- +
-               +
  
                 //OutputToAll('FindRecGivenSysId completed successfully');                 //OutputToAll('FindRecGivenSysId completed successfully');
Line 132: Line 138:
  
                 OutputToForm(outputString);                 OutputToForm(outputString);
- 
                 OutputToLog(outputString);                 OutputToLog(outputString);
- 
 } }
  
-  +Function OutputToForm(outputString){
- +
-function OutputToForm(outputString){ +
                 gs.addInfoMessage(outputString);                 gs.addInfoMessage(outputString);
- 
 } }
- 
-  
  
 function OutputToLog(outputString){ function OutputToLog(outputString){
- 
                 //Log Prefix makes it much easier to find the statements we care about in the system log (table syslog).                 //Log Prefix makes it much easier to find the statements we care about in the system log (table syslog).
  
                 var logPrefix = "FindRecGivenSysId: ";                 var logPrefix = "FindRecGivenSysId: ";
- 
                 gs.print(logPrefix + outputString);                 gs.print(logPrefix + outputString);
- 
                 gs.log(logPrefix + outputString);                 gs.log(logPrefix + outputString);
- 
 } }
 </code> </code>
misc.1737564193.txt.gz · Last modified: 01/22/2025 08:43 by johnsonjohn

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki