- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2017 11:19 AM
I need to place a time constraint on a catalog item. For example, the item is available upon approved request, but only for a 10 day period...what's the best way to apply this constraint?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2017 10:26 AM
You do not need a script include to make sure that the end date is not before the start date, only the lines I added - checked and verified in my instance.
If you have all the script I provided, you should be covered.
Please make sure you added the lines to the correct script.
Also, reload the catalog item page after adding and the lines and saving the script.
If it still does not work, please share your script with the lines included.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 08:18 PM
hmmm, something strange happening now...when I enter "Go To Today", or manually enter today's date in the start field on the catalog item's order form, I'm getting the error we built to prevent entering a date before today's date. Did I inadvertently mess something up? I swear it was working...some kind of internal time zone difference in the system? It works fine if I enter tomorrow, just not today all of a sudden.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 08:26 PM
is it because the system (or this function) is set up on a 9-5 time schedule and so it thinks today is done because the work day is done?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 09:01 PM
and also just to clarify, although a single user is now restricted from making a request for one of these catalog items for overlapping time periods, other users should be able to make requests for the same catalog item for the same time period as someone else...in other words the time frame constriction should not be on the item itself, (more than one user can request the same item at the same time). No user should be able to request more than one of these catalog items for an overlapping time frame. Does this make sense and should your code do that? It appears to be locking out other users from requesting the same catalog item as someone else if there is already an existing request for the same catalog item for the same time period. Sorry if it's confusing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 10:51 PM
About the error - which one are you getting? might need to tweak the code a bit.
About the multiple users - you are correct.
In the last script include, please change the line
open.addQuery('requested_for', user);
to
open.addQuery('request.requested_for', user);
This is because the requested_for field is actually a part of the request table, so we have to dot walk.
Try again and let me know.
Harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 10:55 PM
When impersonating a user who has not yet requested any of these new catalog items, I'm getting the error that they have overlapping requests, even thought it's their first request. Now I do have open requests by other users, but that shouldn't matter. I'll change the code and see if it works. I'm also building a workflow for the delivery of these catalog items, is there any way that could mess up the functionality of the catalog client scripts?