The CreatorCon Call for Content is officially open! Get started here.

Record producer variable value is not mapping to the field in another table

Community Alums
Not applicable

Hi all,

There is no way to use map the field in variable.

I have created a record producer on hr case table and the field was on the employee table. the case gets created on another table at a particular condition. So now i need to map the field value with the record producer value. The field type is choice and the value and the label of both record producer questions and the field choices are same but it was not setting the value. I have used the line in record producer script is:

employee_table.fieldname=record_producer.variable name

 

can anyone help me how to resolve the issue

9 REPLIES 9

Sid_Takali
Kilo Patron

Hi @Community Alums you need to write this kind of script in Record Producer Script field.

if(producer.priority == '1'){
	var gr = new GlideRecord('sys_user');
	gr.initialize();
	gr.first_name = 'User RP';
	var id = gr.insert();
}else{
	var chGr = new GlideRecord('change_request');
	chGr.initialize();
	chGr.description = 'RP Description';
	chGr.insert();
}

 

Regards,

Siddharam

Community Alums
Not applicable

@Sid_Takali Tried this approach it was not setting the value to the field

AnimeshP_96
Tera Guru

Hey @Community Alums 

I am guessing when creating record producer you may have defined table name as employee, so now current is object for employee table, so the script is 

current.field_name=producer.variable_name; 
write this in record producer script


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

Community Alums
Not applicable

@AnimeshP_96 Tried current.fieldname=producer.variable even it is not working