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

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

hi , custom field is still showing empty 

 

Can you share screenshot of the list layout and dictionary form for the custom field.

Best Regards
Aman Kumar

here it is 

I am just doing for learning purposes in PDI

Why have you selected the field as display true in your dictionary form?

Numbers are display for incidents.

Apart from it logic is intact, what happens if you set the field manually?

Best Regards
Aman Kumar