Documentation or information on spScUtil?

ericjackson
Tera Guru

Is anyone aware of documentation on the use and functionality of spScUtil? I'm working on some tweaks to the new SC Catalog Item (v2) widget and I can't seem to find anything about it...

function postCatalogFormRequest() {
		console.log("Start postCatalogFormRequest()");
		$scope.submitting = true;
		if ($scope.data.is_wishlist_item) {
			$scope.is_update_wishlist = false;
			$scope.data.show_wishlist_msg = false;
			if ($scope.data.sc_cat_item.sys_class_name === "sc_cat_item_producer")
				return spScUtil.submitWishlistedProducer($scope.data.sc_cat_item.sys_id, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
			else if ($scope.data.sc_cat_item.item_action === "order")
				return spScUtil.orderWishlistedItem($scope.data.sc_cat_item.sys_id, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
			else if ($scope.data.sc_cat_item.item_action === "add_to_cart")
				return spScUtil.addWishlistedItemToCart($scope.data.sc_cat_item.sys_id, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
		}
		else if ($scope.data.is_cart_item)
			return spScUtil.updateCart($scope.data._generatedItemGUID, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields));
		else if ($scope.data.sc_cat_item.sys_class_name === "sc_cat_item_producer")
			return spScUtil.submitProducer($scope.data.sc_cat_item.sys_id, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
		else if ($scope.data.sc_cat_item.item_action === "order")
			return spScUtil.orderNow($scope.data.sc_cat_item.sys_id, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
		else if ($scope.data.sc_cat_item.item_action === "add_to_cart")
			return spScUtil.addToCart($scope.data.sc_cat_item.sys_id, $scope.data.sc_cat_item.quantity, getVarData($scope.data.sc_cat_item._fields), $scope.data._generatedItemGUID);
	}
1 ACCEPTED SOLUTION
6 REPLIES 6

Jace Benson
Mega Sage

Looks like its one of the file libraries SN includes.

I see it here;

https://gitlab.com/jacebenson/sndocs/blob/master/sources/kingston/0/scripts/app.$sp/service.spScUtil...

You can see your version of it by navigating to ;

https://hi.service-now.com/scripts/app.$sp/service.spScUtil.js

Thanks! Out of curiosity how did you know where to locate that in HI?

That git repo has a script that reads a few endpoints and SN is nice enough to list the sources of their files.  So I just have it hit all the linked files it can cause the front end stuff taht is file based we don't see.  I started tracking those changes.

if you open any page and do a crtl+f in your console for '/scripts/' you should see the comments like i'm suggesting.

Thank you so much for sharing this information!