Using document.URL within a Business Rule

josephtucker
Giga Contributor

I'm fairly new to servicenow scripts, however I'm looking into extracting the current URL via a business rule.

I've noticed var instanceURL = gs.getProperty("glide.servlet.uri") will return the instance URL, however it does not return the current URL that I'm seeing.

I've tried utilizing document.URL; but noticed that does not work (returns with an error).

Would there be another method for extracting the current URL within a Business Rule script?

Thanks in advanced.

6 REPLIES 6

try something like this, might help.



var transaction = GlideTransaction.get();


var ViewNameIs = transaction.getRequestParameter("sysparm_view");



Check what "transaction " shows.


-Anurag

viewing transaction as a string, it returns something similar to:


render: 0:00:00.000, network: 0:00:00.000, chars: 0, SQL time: 170 (count: 42), business rule: 238 (count: 3)




var ViewNameIs seems to return null.