- 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-02-2017 10:42 AM
Sorry I needed to fix the typo in 2 places...had only fixed one of the typos the first time...it works...perfect! Thanks so much Harel! Now is it possible to have these catalog client scripts and script includes cover a number of specific catalog items? Or do I need to recreate catalog client scripts specifically assigned to individual catalog items?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2017 10:53 AM
What I'd do is create variable sets instead of individual fields (variables). Put the onChange scripts I provided in the variable set.
For instance, the script I gave to check that the day entered is not in the past (nowDateCalc) runs on a variable set called date_needed_by which I placed in several catalog items. So I don't need the same script in each if the items, but only once.
This is the variable set:
This is the client script in the variable set:
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2017 11:05 AM
awesome Harel, thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2017 11:55 PM
another question if you're up for it...I am creating a workflow for the approval of these requested catalog items and need to have the requests be approved by the manager of whomever is ordering. I'm creating my workflow and I've generated a "Manager's Approval" workflow activity. I'm seeing that I can put in a script in the "Advanced" section so that the request for approval goes to the manager of whomever is ordering, but I can't find the script. Is a script you know? And as well is there a list or database of commonly used scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2017 05:26 AM
You do not need a script. You can dot walk the user's manager:
In other situations you can write a simple script.
Example: My requested items have a custom "approval" field where I specify what kind of approval the items needs. If the approval is only of the manager, my script will look like this:
answer = [];
if(current.cat_item.u_approval == 'Manager')
answer.push(current.request.requested_for.manager.sys_id);
The script does what the above screenshot does...
harel