Set a field value of a field same as another field

Amit Dey
Tera Contributor

Hi , I wanted to put  field values of short description field to a custom field of incident table in every record , in form view it is working , but in list view custom field is showing empty in every record

1 ACCEPTED SOLUTION

Try below code:

var grIncident = new GlideRecord("incident");
grIncident.query();
while(grIncident.next()){
grIncident.setValue("custom_field_name", grIncident.getValue("description"));// update your custom field name and replace custom_field_name
grIncident.update();
}
Best Regards
Aman Kumar

View solution in original post

12 REPLIES 12

I set display false now , setting the field's value  manually is working .

I am sharing the fix script  

Try below code:

var grIncident = new GlideRecord("incident");
grIncident.query();
while(grIncident.next()){
grIncident.setValue("custom_field_name", grIncident.getValue("description"));// update your custom field name and replace custom_field_name
grIncident.update();
}
Best Regards
Aman Kumar

It worked now , thanks sir