- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2019 11:32 AM
I am using the OOB widget SC Catalog Item and cloned to different scoped application. I am getting an error when I am using that widget.
Did anyone faced the same issue? Could you please provide your inputs?
When I check the logs on choiceListQuantity and got an error as mentioned below.
com.glide.script.fencing.ScopedChoiceList
Part of Script from widget:
var clGenerator = new GlideChoiceList();
var choiceListQuantity = clGenerator.getChoiceList("sc_cart_item", "quantity");
var choicelistQuantityData = [];
for (var i = 0; i < choiceListQuantity.size(); i++) {
var choice = choiceListQuantity.get(i);
if (!isNaN(choice.getValue()))
choicelistQuantityData.push({value : parseInt(choice.getValue()), label : choice.getLabel()});
}
Solved! Go to Solution.
- Labels:
-
Service Portal
- 2,114 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 06:10 AM
I am dealing with the same issues...
You need to remove the () from after the size (so choiceListQuantity.size not choiceListQuantity.size()).
You are also going to have an issue with choiceListQuantity.get(i), it should be choiceListQuantity.getChoice(i).
I am now running into another issue with this widget where the selected item is not showing in the form. When I figure out the issue I'll let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 06:10 AM
I am dealing with the same issues...
You need to remove the () from after the size (so choiceListQuantity.size not choiceListQuantity.size()).
You are also going to have an issue with choiceListQuantity.get(i), it should be choiceListQuantity.getChoice(i).
I am now running into another issue with this widget where the selected item is not showing in the form. When I figure out the issue I'll let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 08:47 AM
Sorry, forgot to mention that isNAN will not work either, so I changed if (!isNaN(choice.getValue())) to if (isFinite(choice.getValue()))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 02:40 AM
Thanks it was helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 10:26 AM
Ok, so that last thing I had to do was lines 195 to 198:
data.sc_cat_item = $sp.getCatalogItem({
sys_id: data.sys_id + '',
is_ordering: true
});
I replaced with data.sc_cat_item = $sp.getCatalogItem(data.sys_id);
and now it is functioning enough that I can start my changes to it.
I hope this helps.