How to run User Criteria on the basis of URL

Harsh Ahuja
Tera Contributor

I just want to restrict the visibility of catalog item on the basis of URL, so for that I wrote one Not Available User Criteria Script which is not working. Below is the script 

var url = top.location.href;
 
if (url.indexOf('now/hr/agent') > -1){
answer=true;
}
 
Please correct me if I am going wrong, or is there any other workaround for this?
Your answer will be helpful for me.
1 REPLY 1

Peter Bodelier
Giga Sage

Hi @Harsh Ahuja,

 

I believe user criteria are evaluated server side. So it won't be possible to use the URL.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.