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

Record producer script to populate the values in incident from record producer variables

FaizDev101
Tera Expert

Create a record producer script to populate name in incident short description

 

Name of the record producer == Short description( incident)

 

after submit the form

2 REPLIES 2

Community Alums
Not applicable

Hi @FaizDev101 ,

 

I am not sure you can get the name of producer in producer script, instead how about using BR to populate that value after the incident is created?

If so, creating BR on table sc_item_produced_record - before - Insert with the Condition 'Record table' is incident, and the script is:

var gr = new GlideRecord('incident');
if (gr.get(current.task)) {
    gr.short_description = current.producer.getDisplayValue();
    gr.update();
}

 

Sai Shravan
Mega Sage

Hi @FaizDev101 , 

 

Create a variable (single line text)[eg of variable name : record_producer_name]  and check the hidden (so that the variable is not visible in the form)

Default value : javascript:current.cat_item;

and in the record producer script use current.short_description = producer.record_producer_name.getDisplayValue(); 

 

Please mark this as helpful and correct answer, if this helps you

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you