- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2014 08:43 AM
Hi guys,
We are building our Service Catalog but when we submit the request, the 'Requested for' field on the Request defaults to the persons name who logged the request.
This seems to be set when we go into the dictionary for the 'Requested for' field whereby the default value us set to 'javascript:gs.getUserID()'
However, the person that logs the ticket wont necessarily be the person that the request is for so i have created variables on the pages which are entitled 'Requested on behalf of'. I have given them the name 'requested_behalf' and would like to link these variables on the catalog item to the 'Requested For' field on the Request.
I tried to change the default value of the field to be 'javascript:gs.getrequested_behalf()' but that does not work.
Is there a way these can be linked?
Thanks
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 08:19 AM
we don't include the approving manager on the request it is in the variable pool though for the item <since it is in the variable set>
for requested for we have a default value of "javascript:gs.getUserID();"
this way it defaults to the customer but they can change it.. we are still on berlin.. so there may well be a better way in calgary.
we did have to create a request level approval workflow to send the approval to the approving manager
we also created a script to set managers approval required on items.. so items that need no approval that is set to no and the approval workflow will skip that approval then...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2014 09:13 AM
Are you using two-step checkout? You can set the requested for on the checkout screen as shown here on the wiki.
Enabling a Two-Step Checkout - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2014 11:32 AM
Hi.
Are you able to change the field names on the form to requested_for? If you have a field requested_for, it'll take that value automatically and use it for the requested item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2014 01:20 PM
the reason it isn't working is requested for is a reference field so you need to fetch the object to use it...
you will need to script an onchange client script to update the manager...
what we did was build a variable set for employee_manager
we include it in every item that needs a managers approval and it sets the requested for and the manager.. in that VS is an onchange script keyed to requested for...
---------------------script---------------------------------------
function onChange(control, oldValue, newValue, isLoading) {
if (newValue) {
var req4 = g_form.getReference('requested_for');
g_form.setValue('v_approving_manager',req4.manager);
g_form.setReadonly('v_approving_manager', true);
if (req4.manager == '') {
alert("Unable to obtain manager information, please contact your manager to order catalog items.");
//window.location="home.do";
return;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 02:03 AM
Hi randrews,
Thanks for this. Would I be correct in saying that you have 2 fields in your variable set:
requested_for
v_approving_manager
Did you then create a new field for requesting manager on the actual request?
Did you do anything else to link the fields in the request to the variables in the variable set? eg did you set any default values etc?
Thanks again