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
‎10-29-2016 11:35 AM
That makes me feel better.... That is exactly waht I was wanting to do......you should add what you have done to Share, im sure a lot of people would benefit from it.
I'm a relative newbie when it comes to coding/scripting in Servicenow so if you could tell me exactly how you have implemented this it would be a massive help.
Thanks
Harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2016 03:45 AM
I guess all I really need to know is what you added/removed from the default SC Order Guide Widget. I've been messing around with it for ages but cant get my head around it.
Thanks
Harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 12:13 AM
I'll have to check with our dev today an dI will let you know!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 03:09 AM
Thanks Tomasz, I am very greatful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 03:47 AM
Well I don't think we can post the entire widgets as this is technically property of our customer now, but here's the most important bits - I hope they will get you going in the right direction:
1. on-click function that is posting the item selected to the cart (this is launched from the widget that holds the list of Catalog Items):
var dataUrl = spUtil.getWidgetURL($scope);
$http.post(dataUrl, $scope.data).success(function(response){
response.result.data.item.required = req;
$rootScope.$broadcast('ourCart', response.result.data.item);
});
2. modification in the order guide widget that handles the event:
- client controller script:
$scope.$on('ourCart', function (event, data) {
function addItem(item){
$scope.included.push(item);
//After 250miliseconds hide loder
$timeout(function(){
$('div[id="dialog_loading"]').hide();
});
- server script:
if(typeof input != 'undefined'){
data.sc_cat_item = $sp.getCatalogItem(input.sc_cat_item);
}
Basically you need to utilize the 'included' object which holds the data posted.
I recommend this recource on github (+ the issues section):