Creating Request item from Record Producer

Nikita3
Kilo Contributor

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.

1 ACCEPTED SOLUTION

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.

https://community.servicenow.com/community?id=community_question&sys_id=7511e2d1dbd7d41066f1d9d96896...

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

5 REPLIES 5

SemiZ
Tera Contributor

Hello @Nikita3 I know this has been a while but can you share how you were successful in creating the request from the record producer.  Thank you!