Is there a way to completely stop deactivated catalog items from being used?

Community Alums
Not applicable

I've got a somewhat interesting issue that has come up.

We have retired (deactivated) many catalog items and users cannot access them from the portal or service catalog which is as expected. The issue we are having is that some people bookmark a catalog item on their browser (have the URL to the item) and if they follow their bookmark they are still able to access the catalog item and submit it.

Is there a way so that when an item is deactivated it is not able to be used at all? Also I am looking for a way to possibly create a pop up or message that lets the user know the item has been deactivated in addition to them not being able to submit or use it whatsoever.

Any ideas would be greatly appreciated! Thanks!

12 REPLIES 12

Kris,



What is the Service Now version you are using? From the bookmark link we don't allow opening Item and throw a generic error.



Thanks


Shouvik


Community Alums
Not applicable

We are currently in Istanbul patch 4


Can you do cache.do and see if there is some caching issue in your environment.


Ideally any update on Catalog Item invalidates the cache. I couldnot reproduce the issue on an OOB IP4.



Thanks


Shouvik


Those users may also need to clean their cache. Because usually when you deactivate an item, user will get an option You are not authorized.


But if they have the item bookmarked, which opens the link directly, may open the page which is in cache.



You can run a background script on all the items which are deactivated. Try it on Non-PROD.



var cat_item = new GlideRecord('sc_cat_item');


cat_item.addQuery('active','!=',true);


cat_item.query();



if (cat_item.next())


{


        cat_item.roles.push('sys id of the admin role');


        cat_item.update();


}



Please mark this response as correct or helpful if it assisted you with your question.

Community Alums
Not applicable

Ok so it seems to be working right in the sub prod instances after cache.do. I will have to try it in PROD to make sure. The next issue is displaying a warning to the user when the item is inactive. Currently the system pops up the message below:



find_real_file.png



Is there a way to edit that message or some other way (Client Script, business rule etc) I can use to display the error message that the business wants displayed?



I have tried a business rule, but it doesn't seem to be working when the user follows the favorite saved ion their browser, its just showing the Not Authorized message.