- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2018 12:34 PM
I created a catalog item that works fine in the standard GUI but fails in the portal. The fields, UI actions, and clients scripts all behave as expected but the screen freezes when I select Order Now or Add to Cart. I did manage to find an error: "could not find script to run for this action" but I don't know what specific script/action it's referring to. I haven't made any changes to any core items (scripts, forms, etc.) so I'm not sure what the problem is. Any advice/direction would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2018 10:00 AM
Rookie javascript mistake. Although I use getIntValue for each box and then add the numbers I was writing a number into the 'total' field when setValue clearly calls for a String... Once I added a step to convert the value into a string the item works properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 01:30 PM
I didn't mean adding anything to the cart, I just meant if you click on the cart to go to it without trying to submit anything. Just view the cart without adding any items to it. Basically go to the portal and click Cart and see if it hangs up or if it loads the empty cart.
Also, I'm curious if you take off the cart layout for submitting and test an item without the cart layout if you still get the error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:32 PM
Incidentally, when I click the link to the URL https://devxxxxx.service-now.com/api/sn_sc/v1/servicecatalog/items/2cf38019dbf92300a3d97fcfbf9619ee/order_now, I'm taken to a page that states "GET method not supported for API". Keep in mind I have not written any code for this, just used existing OOB functionality
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:39 PM
Hi Tim ,
Is this issue you are talking about?
https://hi.service-now.com/kb_view.do?sysparm_article=KB0656139
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 01:49 PM
OK, so apparently I was wrong. I DID write a client script that is causing the problem. The purpose of the script is to update a value (total) based on the values of 4 other fields (disk1, disk2, disk3, disk4). There are 4 identical copies of the script, one for each field being monitored for change. When active, the script does what I want (update the 'total' field with the added value of the 4 fields) but causes a problem when ordering or adding the item to cart. When inactive, the numbers are obviously not added but the item can be ordered/added to a cart. disk1 and disk2 are required but disk3 and disk4 are optional and may not contain data.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var v1 = g_form.getIntValue('disk1');
var v2 = g_form.getIntValue('disk2');
var v3 = g_form.getIntValue('disk3');
var v4 = g_form.getIntValue('disk4');
var vtotal= v1 + v2 + v3 + v4;
g_form.setValue('total',vtotal);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 08:10 PM
Hi tim.saunders@guggenheimpartners.com,
Can you share the error screenshot?
TIA
Prins