misc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
misc [01/22/2025 08:43] – johnsonjohn | misc [01/22/2025 08:49] (current) – johnsonjohn | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Miscellaneous====== | ======Miscellaneous====== | ||
+ | ---- | ||
+ | |||
+ | =====Multiple GETs===== | ||
+ | < | ||
+ | //Get Current Role | ||
+ | gs.hasRole(' | ||
+ | |||
+ | //Get Current User | ||
+ | javascript: | ||
+ | gs.getUser().getUserByID(current.approver).hasRole(' | ||
+ | |||
+ | //Get Instance Name | ||
+ | gs.getProperty(" | ||
+ | |||
+ | //Get Instance URL | ||
+ | gs.getProperty(' | ||
+ | |||
+ | |||
+ | </ | ||
---- | ---- | ||
Line 94: | Line 113: | ||
OutputToAll(" | OutputToAll(" | ||
- | |||
OutputToForm(listViewHTML); | OutputToForm(listViewHTML); | ||
- | |||
OutputToForm(directLinkHTML); | OutputToForm(directLinkHTML); | ||
- | |||
OutputToLog(" | OutputToLog(" | ||
- | |||
OutputToLog(" | OutputToLog(" | ||
- | + | ||
- | + | ||
//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(" | OutputToAll(" | ||
- | + | | |
- | | + | |
- | + | ||
- | + | ||
// | // | ||
Line 132: | Line 138: | ||
OutputToForm(outputString); | OutputToForm(outputString); | ||
- | |||
OutputToLog(outputString); | OutputToLog(outputString); | ||
- | |||
} | } | ||
- | + | Function | |
- | + | ||
- | function | + | |
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 = " | var logPrefix = " | ||
- | |||
gs.print(logPrefix + outputString); | gs.print(logPrefix + outputString); | ||
- | |||
gs.log(logPrefix + outputString); | gs.log(logPrefix + outputString); | ||
- | |||
} | } | ||
</ | </ |
misc.1737564193.txt.gz · Last modified: 01/22/2025 08:43 by johnsonjohn