how to check if the URL is from portal or native view

KaMmILa__
Tera Expert

Hello everyone 

we have a view rule in which we are checking if the URL is from the portal or not based on that we are enforcing the users to some views. Below is the code we are using, and if it is in the portal there are some other views we are dealing with which is working fine on initial load, the only issue we are having here is if the RITM is opened in the portal we are restricting the UI actions. but when I try to open the requested item it is showing save UI action ( which is as expected and working fine) upon clicking save even though it is in the portal it is going to default view( which is not correct) 

 

when I tried to click save the URL is not changing at all but the view is changing to default view which is opening up all the UI actions which we don't want 

* we excluded the UI actions in Portal view still they are showing in default view.

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron
try with gs.action.getGlideURI().toString().startsWith('api/now/sp’) It will return true false .

View solution in original post

1 REPLY 1

Harsh Vardhan
Giga Patron
try with gs.action.getGlideURI().toString().startsWith('api/now/sp’) It will return true false .