Extremely long loading time on Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2016 02:54 AM
Hi everyone,
I am struggling with a big issue regarding the new Service Portal. Wonder if anyone has had a similar experience and have you been able to find a solution?
Basically I am using the Order Guide widget to allow end users to choose multiple items under a request and provide some general information in the order guide fields.
I have 48 items included in the order guide and the SP loading times are ca. 15-30 seconds!! absolutely terrible.
What happens is SP loads all the related catalog items together with their variables, client scripts etc. at the beginning of loading the page. That is fine but why is it taking so long? We are not speaking 10 MB of data, this is all in JSON format, it should definitely work faster.
Official response from SN was "kindly remove the order guide and use SP as in the out-of-the-box version (simplified homepage, ordering single items)". Unfortunately, not possible in this case. So perhaps someone had any experience with order guide widget/functions and knows of any tricks I could implement? I would be very grateful for any hints.
Thanks,
Tomasz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2017 11:41 PM
Hi Sylvain,
I am afraid I do not have the admin access to that instance anymore, so cannot check exactly how it was coded, but as far as I remember we would load the Order Guide without any items (just order guide variables), then on a "next step" we would show tiles with all catalog items that could be selected and after clicking each item, we would load it into the Order Guide. I think that was the moment when the sp.getCatalog Item would be launched, after the item was added to the cart.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 04:52 AM
Hi Tomasz, thanks for your reply.
I ended up keeping the getCatalogItem, but executed on a standard catalog item so that it doesn't load anything else. Then, the client script is calling the server to get the sc_cat_items on demand. That was quite easy in our case because the included items depended only on the content of a glide list variable.
In this particular case, our new custom lite guide is really faster than the original one, even with just a few items.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 05:01 AM
Hi Sylvain,
Would you mind sharing any code you can on how you achieved this, we aren't having much luck.
Thanks
Harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 05:16 AM
I found a bit of code I had saved somewhere that relates to this:
if(typeof input != 'undefined'){
data.sc_cat_item = $sp.getCatalogItem(input.sc_cat_item);
}
I think we used that in the server part of the order guide widget (modified the OOB widget). So basically you need to make sure that on click of a desired item, you send the item ID to the server via the input object and then you can load this individual item into the order guide, as opposed to loading every possible item.
Just checked the OOB version and they use
data.sc_cat_item = $sp.getCatalogItem(data.sys_id);
which I think is the issue, as I guess it pulls every item/script that has anything to do with the order guide. I am not an expert on Angular/SP though

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 07:20 AM
@Tomasz,
The problem with just not calling getCatalogItem when input is undefined is that you won't even get the order guide definition itself, so you'll just get a blank screen. This is why I asked you how you constructed the sc_cat_item object for the guide.
@Harry
I'm sorry I can't post the code because I don't own it, but if you have specific questions I can try and help.
Do you have a simple requirement like mine ?