- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2020 01:48 PM
I have a record producer with some variables and when I create a request from the portal , I want another request to be created for another record producer and populate the variables for that. How do I script it out?
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2020 02:46 PM
Once you submit the record producer, the variable values will be stored in Question Answer (question_answer) table.
You might need to come with a logic to do an insert on this table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2020 02:02 PM
Hi,
You cannot trigger record producer submission through script, like you do it for catalog items.
Since record producer main purpose is to create records on tables other than sc_request, sc_req_item and sc_Task, you can make use of GlideRecord and insert the record in the table.
Use similar Script of Record producer and insert record in other record producer target table:
var otherrec = new GlideRecord('my_table_name');
otherrec.initalize();
otherrec.field1 = "value";
otherrec.field2 = "value2";
var resSysId =otherrec.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2020 02:06 PM
But the second record producer has got some variables which I need to populate from first record producer.
How do I do that ...Not all variables are mapped to the target table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2020 02:46 PM
Once you submit the record producer, the variable values will be stored in Question Answer (question_answer) table.
You might need to come with a logic to do an insert on this table.