I created one String field and given default value. but that value is not reflecting on old records.what do i need to do to populate that string on old records.Is there any property i need to set?or do i need to run schedule job to update all recs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2014 07:36 AM
Please suggest the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2014 08:02 AM
Hi Mayur,
Update the old records using a Background script.
Thanks,
Avneet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2014 08:05 AM
Default value gets updated only for new records. For old records you will need to write a background script.
Make sure you use setworkflow(false) amd autoSysFields(false) in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2014 08:07 AM
Hi Mayur,
Avneet pointed you in the right direction.
You will have to Query and Update all your records that contain this New table.
You will have to use:-
gr.setForceUpdate(true); // assuming your Glideobject variable is gr
gr.setWorkflow(false);
gr.autoSysFields(false);
Thanks,
Subhajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2014 08:08 AM
Hi Mayur,
Goto Scripts Backgroud and execute a code like this:-
var gr=new GlideRecord('<table_name>');
gr.addQuery('<field_name>','!=','<string_value>');
gr.query();
while(gr.next()){
gr.<field_name>='<string_value>';
gr.update();
}
Here I m checking for records that does not have this field equal to the default valur and then updating them with the defqault value.
Hope this helps.
Thanks & Reghards,
Hari