
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 03:43 AM
Hi,
I'm having some technical difficulties about the catalog item quantity field. The question is, how can I make the quantity field in the catalog item unlimited (like integer field). It is an integer field but I assume due to portal configurations It is shown as a choice list. I don't want to add choices up to 10.000 quantities. It doesn't seem like a good way to do. Is there a better option that people can edit the field with the quantity they want ?
The reason why I'm trying to this is that our customer is providing some equipments which are being sold with a minimum quantities like 100, 1.000, 10.000. We are planning to make a field which the customer will declare the minimum quantity of the item. Than the user will only be able to order within that quantity range.
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 10:55 AM
Here are more details about how we implemented this, which may get you closer. I am seeing the user-supplied free text quantity in the cart with the correct total price based on this quantity.
1. Create a variable set containing only the new Quantity (single line text).
2. Add the variable set to the catalog item(s).
3. Create a before Insert/Update business rule on the sc_item_option table:
a. add a condition: Question is <<new quantity>>
b. Script on the Advanced tab:
(function executeRule(current, previous /*null when async*/) {
// Get the current Cart Item and Value from the catalog item option.
var cartItem = current.cart_item;
var qty = current.value;
// Query the cart and update its Quantity value with the value from the variable.
var gr = new GlideRecord('sc_cart_item');
gr.addQuery('sys_id', cartItem);
gr.query();
while(gr.next()){
gr.quantity = qty;
gr.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 07:07 AM
We've worked around this by hiding quantity on the item, then adding a variable for it. You can copy the variable to sc_req_item.quantity on submit so that they are in agreement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 07:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 11:01 AM
Hi,
Were you able to find a solution / work around?
I am able to push my custom quantity to the quantity table on submit of the catalog items and this sets the quantity and total fields on the RITM, but I can't get the shopping cart and bundles to show the right quantity.
Thanks,
Sharon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 10:55 AM
Here are more details about how we implemented this, which may get you closer. I am seeing the user-supplied free text quantity in the cart with the correct total price based on this quantity.
1. Create a variable set containing only the new Quantity (single line text).
2. Add the variable set to the catalog item(s).
3. Create a before Insert/Update business rule on the sc_item_option table:
a. add a condition: Question is <<new quantity>>
b. Script on the Advanced tab:
(function executeRule(current, previous /*null when async*/) {
// Get the current Cart Item and Value from the catalog item option.
var cartItem = current.cart_item;
var qty = current.value;
// Query the cart and update its Quantity value with the value from the variable.
var gr = new GlideRecord('sc_cart_item');
gr.addQuery('sys_id', cartItem);
gr.query();
while(gr.next()){
gr.quantity = qty;
gr.update();
}
})(current, previous);