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

atv1
Giga Expert

Are you updating the records after passing the values on a field? 

Amit Dey
Tera Contributor

 Yes ,

I created a new custom field and want to pass the value of short description  in  that field  in every record in incident table 

Hi @Amit Dey 

What are you using to capture description in custom field?

If it is a one time activity, use a fix script for this.

Best Regards
Aman Kumar

Hi can you share the code