- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 07:09 AM
I want to create a new field (integer) with a value"0" on Incident table. I want this value to be applied on new as well as existing records.
Will the "Default Value" work? if not please suggest any other option.
Thank you,
Navdeep
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 07:34 AM
And they weren't updated:
Yes, we did it differently.
I went through the dictionary
1. went to System Definition -> Dictionary. Clicked on new
2. Choose the incident table, Integer type, and added 0 as default value:
3. Clicked on Submit
4. Run the script to confirm:
Telmo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 07:47 AM
You can do it like Chuck said, with a background script:
var inc = new GlideRecord('incident');
inc.query();
while (inc.next()) {
inc.setWorkflow(false);
inc.autoSysFields(false);
inc.u_count_field = 0; // Change to YOUR field name
inc.update();
}
Telmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 08:11 AM
Hi Telmo,
Thank you for the information.
If I delete the old column and create a new one with same name using Dictionary as you mentioned, will it work ?
I tried to create new application by deleting old one with same name, but not worked because of same name.
Thanks,
Navdeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2016 02:24 AM
Hi Navdeep,
Maybe again some differences on how you do it.
I deleted my field through the Dictionary, and created a new one also from the Dictionary with the same name and even a different type, and I was able to.
Regards,
Telmo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 08:07 AM
Interesting that doing the value from the dictionary would differ from doing it from the configure table. Thanks for sharing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2016 07:26 AM
Hi Chuck,
Thanks for this Information.
Regards,
Navdeep