- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 10:36 AM
Hello Community,
Is there a way I can query the URL parameters from a Business Rule?
I see that the 'Copy Change' UI Action is framing an URL which will contain parameters 'sys_id', 'sysparm_query' and 'sysparm_goto_url', I am interested in capturing these URL parameters in a before query business rule. This business rule runs before a new record is created (where sys_id = -1).
Thanks,
Hari
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 10:28 AM
I was able to get along by using 'gs.action.getGlideURI()' to retrieve URL parameters in a Business Rule.
I used the following approach to check if the URL contains a certain look up string:
gs.action.getGlideURI().toString().indexOf('Search String')
I used the following to get the value of URL Parameters:
gs.action.getGlideURI().getMap().get('URL Parameter Name')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2016 07:27 PM
I don't quite get the scenario you are going for, but regardless... you need a way to take information from the client (URL parameters) and access them from Server Side.
The only things I can think of is trying to use GlideAjax to store the parameters somewhere, or Session Client Data (or a combination):
putClientData(name, value);
getClientData(name);
clearClientData(name);
-Ken Michelson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 12:03 AM
You can use current.operation() == 'insert' instead. No need to "capture" URI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 01:15 AM
I'm not sure if the Business Rule can access them, but you can get parameters and values using:
RP.getParameterValue('sysparm_whatever');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 10:28 AM
I was able to get along by using 'gs.action.getGlideURI()' to retrieve URL parameters in a Business Rule.
I used the following approach to check if the URL contains a certain look up string:
gs.action.getGlideURI().toString().indexOf('Search String')
I used the following to get the value of URL Parameters:
gs.action.getGlideURI().getMap().get('URL Parameter Name')