Create REcord Producer record

maryc
Tera Contributor

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

 

1 ACCEPTED SOLUTION

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. 

View solution in original post

3 REPLIES 3

Gowrisankar Sat
Tera Guru

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();

 

 

maryc
Tera Contributor

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

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.