- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-12-2025 05:43 AM
I encountered a use case where the customer required the native view for catalog items to show an alert that they cannot use the item and redirect them to the portal. Obviously, there are times where this may be required so the solution is "Dynamic" and can be applied to specific items if required and isn't a customization to the platform.
Create a variable set and a catalog client script in the variable set with the below code and configurations.
- UI Type : Desktop
- Applies on a catalog item view : True
function onLoad() {
var portalLink = "https://harneet.service-now.com/"; //Link in the message if you want to add
var redirectPortalURL = "/esc"; // Portal currently enabled and used by employees
alert("Please raise your request through the Portal - " + portalLink + "\n" + "The ability to create requests for this item on the backend is disabled");
top.window.location = redirectPortalURL + "?id=sc_cat_item&table=sc_cat_item&sys_id=" + g_form.getParameter('sysparm_id');
}
This is how it should be looking like once configured
Apply this variable set to all those catalog items which you do not wish users, agents to submit from the backend view.