- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:14 AM
I have a requirement.
On a Catalog form, there is a Change Request reference field. So, when Catalog form gets submitted along with the Change Request number, an RITM gets created.
So, the requirement is, this RITM should be then linked on the Change Request Related List (change number which we gave on the Catalog form).
How should I achieve this with Run Script Code on WorkFlow ? I have created a workflow on sc_req_item table. But I will use Run script action and will write code.
I have written some code in Workflow but it is not working. Please help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:43 AM
current.parent = current.variables.change_request_number_1+'';
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:17 AM
@AbdurRahmanSnow There is no such OOTB field with name sc_req_item on the change request table. Are you sure that such a field exist on your instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:19 AM
Sandeep, I am assuming it, because the back-end name of the RITM is sc_req_item. But on the Change Request, I was not able to find RITM back-end name.
Please check. Would be grateful for that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:27 AM
@AbdurRahmanSnow If you want to show the RITM in the related list of Change request then you can do the following change inside your workflow run script.
var ritm = current.sc_req_item.getRefRecord();
ritm.setValue('parent', current.variables.change_request_number_1);
ritm.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:38 AM
Sandeep, thank you so much. I really appreciate.
But will you please give the complete code? I am totally confused. I would be grateful for that.
Because here "current" means RITM table, because I will use this code on Workflow Run script and Workflow is created on sc_req_item table