Populate "Requested for" and "Opened by" fields on RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2019 02:56 PM
Hi Friends,
I have created a catalog item. There are 2 fields (both are reference fields referencing to USer table), Requestor (u_requestor) and Behalf of (u_behalf_of) on the form.
When i submit that item, Request is getting created and corresponding RITM is also getting created. In work flow i have written a run script to populate values on RITM. I want to populate Requestor field value in Opened by in RITM and Behalf of value in Requested for field in RITM. How can i populate those values into them?
Please note my workflow is on RITM, and after begin activity, i written a code in Run Script activity like,
current.opened_by = current.variables.u_requestor;
But its not working. Can some one help me on this?
Regards,
VIjay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2019 10:17 PM
create a before business rule on req item.
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request', current.sys_id);
grRITM.query();
while (grRITM.next()) {
if (!JSUtil.nil(grRITM.variables.requested_for)) {
current.requested_for = grRITM.variables.requested_for; //I am assuming requested_for variable here from form.
}
}
Note : Please mark my answer correct / Helpful so this question will not wipped out from the community .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2019 07:09 AM
Thanks Pavan for the response.
But i have glide record the request table, and populated the fields that reflects to ritm in runscript activity.
Its working now.
Regards,
Vijay