Record producer variable value is not mapping to the field in another table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 05:19 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 05:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 06:44 AM
@Sid_Takali Tried this approach it was not setting the value to the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 05:57 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 06:44 AM
@AnimeshP_96 Tried current.fieldname=producer.variable even it is not working