logo

NJP

Prevent catalog item submission from backend submission and redirect to relevant portal link

New article articles in ServiceNow Community · May 12, 2025 · article

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.

View original source

https://www.servicenow.com/community/developer-articles/prevent-catalog-item-submission-from-backend-submission-and/ta-p/3260617