- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 04:48 AM
Ask: For the comfort of end user , we want to create incident and request using same record producer. I have been successful in creating request from the record producer (let me know if you want to know), but need to know 2 things here.
1.) I want the user to redirect the user to the record he created using RP. So far I have been successful in redirection to List view of requests using: producer.portal_redirect = "sp?id=index"; but here I want to redirect to current record requested, like it happens normally after creating Incident.
2.) How can I copy/populate the values of record producer(the user filled in while creating) to my request generated form (RP variables to RITM fields)?
Attached is the screenshot (eg.: copy contact number from RP to variable section in RITM).
Any leads, appreciate.
Solved! Go to Solution.
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:52 AM
Glad to know my response helped you solve your issue.
Ques: Ways to populate fields on RITM
As you are using cart API you will get request sys_id of REQ after request is submitted.
You can use that sys_id to get REQ and RITM's using Glide Record query.
var req = cart.placeOrder();
var reqRecord = new GlideRecord('sc_req_item');
reqRecord.addQuery('request',req.sys_id.toString());
reqRecord.query();
if(reqRecord.next()){
reqRecord.assignment_group= 'sys_id of group';
reqRecord.update();
}
You can check below link for similar approach.
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 05:07 AM
Hi,
To Redirect to current record you can use something like this:
producer.redirect = "sp?id=form&table='tableName'&sys_id="+current.sys_id;
How you are creating request and requested item?
Through workflow/BR or record producer script?
If it is through RP script then you can use producer.contact to access values selected in record producer and user it while creating request and requested item.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:40 AM
Hello Anil,
Thank you for response.
The redirect link and access to variables worked successfully.
I created request using CartAPI() in record producer script and was able to populate variables in variable section in RITM.
However, could you suggest some ways to populate fields on RITM (not of variable section) which are not on Record Producer. Eg.: Assignment Group, Short description.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:52 AM
Glad to know my response helped you solve your issue.
Ques: Ways to populate fields on RITM
As you are using cart API you will get request sys_id of REQ after request is submitted.
You can use that sys_id to get REQ and RITM's using Glide Record query.
var req = cart.placeOrder();
var reqRecord = new GlideRecord('sc_req_item');
reqRecord.addQuery('request',req.sys_id.toString());
reqRecord.query();
if(reqRecord.next()){
reqRecord.assignment_group= 'sys_id of group';
reqRecord.update();
}
You can check below link for similar approach.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2022 02:36 AM
Thank you for your help, Appreciated.