- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2014 02:51 AM
I have a bit of an issue at the moment with the requested for field.
We use two fields on the request:
Requested By - Default is the current USERID
Requested For - default is blank
On the actual request the requested by is the user raising the request and the requested for is the person who the request is for IE
Requested By - Pennie
Requested For - Tracy
After I have gone through the 2 stage shopping cart, the request shows as both as Pennie, and the actual requested Items show correctly as pennie for the requested by and tracy for the requested for.
We are on Calgary release and I'm stuggling to find why its not setting it correctly on the request?
Can anyone help?
We have the requested for delivery details turned off because of this error (UI Macro called catalog_requested_for), as on the cart it shows wrong aswell, but if you go back to the request (eg edit it) it shows what you actually put.
Thank you in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2014 03:23 AM
We have this as a BR in sc_request
set as a Before Insert / Update
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request', current.sys_id);
grRITM.query();
while (grRITM.next()) {
if (!JSUtil.nil(grRITM.variables.requestor_name)) {
current.requested_for = grRITM.variables.requestor_name;
}
}
Added by someone from Servicenow for us
We also have a Variable Set called requested_for_vars
that has the requested_for variable in there
Otherwise I would suggest you look at the audit history and see if it is changing as well as looking at all your BR's to see if they are doing anything
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 08:48 AM
For us, the REQ has the requested for information as passed by the record producer
we only ever go back to this value and not the variable - though should actually work
so in your example, we would have
current.requested_for = grRITM.request.requested_for;
I have just run this against one our records and they give me the same value and it is the same and correct user.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number','RITM0198898');
gr.query();
while(gr.next())
{
gs.print(gr.variables.requested_for);
gs.print(gr.request.requested_for);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 08:53 AM
Will try.Thank you.