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
07-28-2018 07:03 AM
Hi Peter,
Thanks so much for your guidance and pointing out in using 'console.log(input)'; found the root cause through there.
Below is my code that I used :
var getRequestor = '';
for (var i=0; i<input.items.length; i++) {
if (input.items[i].variables.hasOwnProperty('requested_for')){
getRequestor = new GlideRecord('sys_user');
if(getRequestor.get(input.items[i].variables.requested_for)) {
options.requested_for_id = getRequestor.sys_id.toString();
options.requested_for_display = getRequestor.name.toString();
}
}
}
Since the Order Guides can have multiple catalog-items, the items are stored as array-items; hence input.items[] returns the desired outcome.
Your code returns the desired requested-for even if the variable is hidden by UI-Policy, which is in a way a better solution that you do not require multiple places to input the data, i.e on each catalog-item as well as the Order Confirmation > Request For field.
Thank you so much once again for your code and the guidance.
Regards,
Samiul
p.s: I am using the updated widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 10:37 PM
Ah, nice catch... yeah, that makes sense about the input array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2018 10:45 PM
Hi Peter,
Just noticed that the 'location' value linked with the user record does not populate in the 'Delivery Information' textbox.
If you change the value of 'Request For' within the 'Order Confirmation' popup window, then 'Delivery Information' gets updated with the changed record's location value.
By any chance could you advise how to pass the location value from Catalog Item's "Requested For" variable to "Delivery Information"? I have tried numerous options but not able to find any outcome.
Also, is it possible to make the 'Delivery Information' textbox mandatory?
Thanks in advance,
Samiul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 10:40 AM
Hi Samiul,
I am trying to copy the requested for from the order guide to the popup i am not able to achieve it. i tried using the below code
// added to pick up the requested for field & pass to order now
if(input.itemDetails.fields.hasOwnProperty('requested_for')){
var getRequestor = new GlideRecord('sys_user');
if(getRequestor.get(input.itemDetails.fields.requested_for)){
options.requested_for_id = getRequestor.sys_id.toString();
options.requested_for_display = getRequestor.name.toString();}
}
with var embeddedWidgetOptions = ['auto_redirect'];
It worked for single catalog items but it is not working for the order guide.. Tried using your code it didn't work can you please share some inputs that worked for you.
TIA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2019 12:44 AM
Thank you Peter!
Your solution worked like a charm for me and solved my problem 🙂