Jaspal Singh
Mega Patron

Hi Robert,

If I understand correctly you have created a new field u_year_end_date and wish to populate the value in this field for all existing records submitted before the field was created.

If so, you need fix script or background script to update it for existing records as below.

var gr = new GlideRecord('sn_hr_core_profile');
gr.setLimit(10);//do it for 10 records.. once it works fine comment this line
gr.query();
while(gr.next()){
var valueis=parseInt((gr.employment_end_date).substring(6,10));
	gr.setValue('u_year_end_date', '31-12-'+valueis);
	gr.updateMultiple();
}

 

View solution in original post