- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 04:34 PM
I'm trying to add a new check box field to the Istanbul Service Portal Shopping Cart, with the ultimate goal of the true/false value making its way to the Request, but, I'm stuck.
What I've done so far:
- I've created the appropriate column on sc_request
- I've modified the 'large_shopping_cart.html' Angular ng-template to get the appropriate field on the Portal page
- I've modified the 'SC Shopping Cart' Widget Server Script and Client Controller so that everything is processed properly. I've logged what is being returned on submit, so I know we're working up until this point.
This is where things get a little fuzzy for me. From what I can tell, the 'SPCart' Script Include is called from the widget and all the appropriate data is sent on it's way. But I don't know what to do from here?
Has anyone done something similar on the Portal Shopping Cart that can point me in the right direction?
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 01:29 PM
I just completed adding a few fields to the Service Portal shopping cart. From what I can tell that is part of the backend process that we do not have access to. I ended up creating a new Script Includes with my logic and inherited the SPCart script.
One thing I was held up on, I have minimal knowledge of the shopping cart structure, you must add whatever fields you are wanting to both the sc_request and the sc_cart tables. Then I just used this article for the cartpop since I was adding more than one new field.
There may be an easier/new way to do it with the Service Portal but I haven't seen any documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 04:33 AM
i am not able to get , can you help me please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 05:42 AM
How to do record and field lookups in Service Portal - This article will help with referencing items based on the requested for user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 09:48 AM
thanks Harish/Dustin,
We can be able to auto populate Approver value. But i want to get Cost centre value as well .the below script used to get the approver value.
Client Script:
c.deliverTo = c.data.location;
$scope.$on("field.change", function(evt, parms) {
  if (parms.field.name == 'requested_for') { //detects that requestor name has changed
   c.deliverTo = '';
c.data.u_approver ='';
   c.server.get({ //send the server the new user ID & action is to update the location
    userID: parms.newValue,
    action: "get_user_location"
   }).then(function(response) {
alert(response.data.location);
    c.data.u_approver = {
displayValue: response.data.location,
value: response.data.location,
name: response.data.location
};
   });
   }
});
~~~~~~~~~~~~~~~~~~~~
Server Script:
if (input && input.action === "get_user_location") {
  userID = input.userID;
}
data.location = getUserLocation(userID);
function getUserLocation(userSysID) {
var sysUserGR = new GlideRecord("sys_user");
  sysUserGR.get(userSysID);
  var newLocation = sysUserGR.getElement("manager");
  return newLocation.getDisplayValue();
}
where i need to add to get cost centre value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 10:06 PM
i repeated the same script for cost centre its working fine .. thanks for the support

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 02:59 AM
Hi Harish,
One more help, could you advise me how to make approving manager, cost center, department [custom fields ] I have created in the cartlayout to be mandatory in the cart layout servicenow