Obtain current URL from display business rule

cre1014
Kilo Expert

Right now we have an error message that pops up as an alert on our ESS page as well as our Support view page. We have a business request to remove the error message from the ESS View, but not the Support View. Because multiple roles can see both pages, we have to stop the error message based on the page view rather than whose's viewing it.

 

We're having trouble grabbing the main URL for the catalog task page where the error message appears. Is there any way to grab the current URL from the server side through a display business rule?

 

Any and all help would be appreciated, thanks!

2 REPLIES 2

AdityaTW
Mega Contributor

What generates the alert - is it an onLoad client script on a certain form?


You could try with something like: if (view.startsWith("ess"))


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Caitlyn,



You could use something like RP.getReferringURL(), but I think that might only get you the url of the frame.



Assuming when you say ess page you mean cms portal, you should be able to check the URL of the browser in your client script to see if it has your ess portal suffix in it. Something like:



if (top.location.toString().indexOf('/ess/') > -1) {


    //do something


}