Order Guide's Catalog Client Script not running onSubmit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:27 PM
Hi everyone,
I'm working on the order guide to facilitate communication between HR, Help Desk, Facility Management and managers.
In a case of an employee status change (promotion, change department...) HR submit a form that will trigger some task and send an email to the manager. This email contains a link to an order guide with bunch of parameters already pre-filled to avoid mistakes. I have a loop in my workflow to check if the manager has submitted the order guide or not. I'm trying to update the main ticket (submitted by HR) when the manager submit the order guide so I don't resubmit the email to the manager.
My issue is that I can't seem to update the main ticket after users check out on the order guide. I wrote a catalog client script to be called onSubmit on requested items and catalog task.
On the order guide, catalog client script:
Script include called by the catalog client script:
The script is called when I check "Applies on a catalog Item view" but then it's called when the manager is reviewing the item. If the manager doesn't submit the order this option will still update the ticket as the script was triggered on the view.
I also tried different ways to do it but nothing worked.
I'm on Kingston.
Do you guys have any idea?
thanks,
Raphael.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 04:47 PM
I don't think you need a client script to do this.
Use a on Insert business rule on requested item table and use the below script
Also, make sure you run the business rule only for a particular catalog item.
var gr = new GlideRecord("u_human_resources");
gr.addQuery("sys_id", current.variables.parent);
gr.query();
if (gr.next()) {
//Rest of the script goes here
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 04:47 PM
Hi,
I'm pretty confused as to what you're trying to do and when so I'll sort of just explain when the OnSubmit in an order guide runs...so...the moment you click next after filling out the initial form of information on an order guide...that's when it runs...that's it.
AFTER...then you see all the items included or selected show up...and at that time all the OnLoads run for all of them....
Then when you submit finally...(even though it's sort of still in the order guide package)...all of the items onSubmit run....so could be 1-6 onSubmits across all those items running (depending on how many you have).
So...again, Order Guide onSubmit runs the moment you click next or whatever...that's it.
It's NOT run when you click checkout/order at the very end.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 09:30 AM
thank you for your answer, it confirms what I previously thought: the onSubmit works only when clicking next.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 05:26 PM