Skip to content

Instantly share code, notes, and snippets.

@icerge
Last active December 6, 2023 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save icerge/25c9b1925536764d917a9197e66fe8b0 to your computer and use it in GitHub Desktop.
Save icerge/25c9b1925536764d917a9197e66fe8b0 to your computer and use it in GitHub Desktop.
Server side story of how to get URL parameters

gs.action

gs.action.getGlideURI().get('parameter_name');

Another longer alternative:

gs.action.getGlideURI().getMap().get('sysparm_query');

GlideTransaction

var transaction = GlideTransaction.get();
var targetRecord = transaction.getRequestParameter('sysparm_record_target');

Used in ApproverUtils SI: nav_to.do?uri=sys_script_include.do?sys_id=4b28d4fcc78533003725756d5ec2600c

@d-oderbolz
Copy link

This does not work in before query business rules. I had some success with

var targetRecord = RP.getParameterValue('sysparm_record_target')

But this creates an error entry in the syslog every time it runs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment