How do we update the Requested For in the Order Confirmation Pop Up?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2018 07:50 AM
As part of the Kingston upgrade it now displays an Order Confirmation dialog after you click Order Now. The problem we're having is it doesn't pull the Requested For from the catalog item we're ordering, so if the user changes the Requested For it doesn't update the Requested For in the Order Confirmation window. As you can see in this screenshot they are different.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 06:14 AM
Thanks for this, just tested it and works well, the only other thing is that on my personal dev instance that I just got spun up in Kingston, the original widget works as expected, i.e. change the Requested for and this is then reflected on the created Request, not sure if this is a bug when upgrading from a previous release where a fresh install works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 01:59 PM
I'm doing a fresh install of Kingston for a client that was spun up last week and needed this fix... so I guess the latest patch resolves it??? IDK. Something to keep an eye on, I guess 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2018 01:36 AM
Morning,
I am still currently trying to figure this one out on one of my work dev environments, no option of a fresh install, I noticed a couple of the OOB widget instances were missing after the upgrade from Jarkata to Kingston which I imported as XML but no dice.
If I finally figure it out I will let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2018 03:46 AM
Hi Peter,
Thanks so much for your script, it has been extremely helpful for single catalog items.
I was wondering if you could help to achieve the same outcome for Order Guides? I have the 'requested_for' variable on the included catalog-items for the Order Guide, but on the 'Order Confirmation' popup > "Request For" text-field displays the currently logged in user. I have cloned the widget "widget-sc-order-guide-v2", and added your code in its Server Side function but not getting the desired output.
Here is my added code into that widget:
var getRequestor = '';
if (input.items.hasOwnProperty('requested_for')){
getRequestor = new GlideRecord('sys_user');
if(getRequestor.get(input.items.requested_for)) {
options.requested_for_id = getRequestor.sys_id.toString();
options.requested_for_display = getRequestor.name.toString();
}
}
If you could assist, that would be huge help!
Thanks in advance,
Samiul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2018 04:24 AM
Hi Samiul,
Check with a fresh dev instance to see if you get the new (fixed) widget as described by Ashley.
Beyond that, check that you're using the code correctly. In my solution, I use "input.itemDetails.fields" but you're using "input.items" that might be the cause of the problem.
If my code isn't working for you, try adding console.log(input); to see precisely what's in the input object and dot-walk to the field you're after in your code.
If the page is refreshing and you're losing the console logging in your browser, try gs.info('order guide: ' + JSON.stringify(input, null,3)); and then go to your system log and search on "order guide" and you should find the input JSON object written out there.
Unless things have changed, I suspect all you need to do is use input.itemDetails.fields
Also, be aware this widget will change again in London (and hopefully be fixed) as they're introducing multi-line variables.
Have fun