- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2018 03:31 AM
Hi All,
I would like to get few solutions for my problem related to parent & child workflow.
I have created a custom table which extends 'sc_request' table & record producer form.
Once the user submits the form it will create entry in that custom table & it will attach to the workflow which I have created for that table.
In that workflow I have attached another workflow (sub workflow) which will create Requested Item.
The problem here is, my attached workflow is not creating the RITM. But it seems its alone working fine. When I include that workflow in my custom table workflow it's not working (not creating RITM).
My custom table is an extended table of sc_request & it has 'Requested Item' Related List.
What is the problem here? What should I do?
Please suggest/help me.
Regards,
SNOW
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2018 03:09 AM
I handled it by adding the following lines in Run Script
var catItemId = "SYSID"; //sys_id of an item needs to be created as a new RITM
var requestId = current.sys_id;
var helper = new GlideappCalculationHelper();
helper.addItemToExistingRequest(requestId, catItemId, "1");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2018 04:30 AM
You can create your RITM using Run script and then your workflow will auto-attached with created RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2018 05:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2018 08:02 AM
1) Add Workflow in your Catalog item configuration.
2) Add run script in your custom table workflow to submit above Item.
Refer - https://community.servicenow.com/community?id=community_question&sys_id=73ce7ea5db58dbc01dcaf3231f9619b8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2018 01:04 AM
Hi
Thanks again
1). Added workflow in my Catalog item configuration
But I don't know how to submit the above item in a script
I have included the below code, but its only creating new RITM without the workflow.
var ritm = new GlideRecord('sc_req_item');
ritm.initialize();
ritm.request = current.sys_id;
ritm.cat_item = "SYS_ID";
ritm.insert();