- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:29 AM
I am looking for the easiest and quickest way to add a value to a new column for all rows in a table. This only needs to be a onetime script and I will be populating the same value 'NRFUS' to the same column 'Member Firm' on the same table 'u_assignment_assistance' for all rows. Any thoughts?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:51 AM
Even easier might be to:
- go to the list view of the table
- right click on the column headers
- click Update All
- click OK to accept changing all records
- input 'NRFUS' to the Member Firm field (without changing anything else)
- click Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:47 AM
Hello Jared,
Assuming, the Member Firm field is a string, and its name is u_member_firm, this should work. You can run it in the 'Scripts - Background'. You can search for it in the Application Filter.
var gr = new GlideRecord('u_assignment_assistance');
gr.query();
while(gr.next()){
gr.u_member_firm = 'NRFUS';
gr.update();
}
I would probably put a gr.setLimit(10); in between lines 1 and 2 to test first to verify that it has the expected results before you do them all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:51 AM
Even easier might be to:
- go to the list view of the table
- right click on the column headers
- click Update All
- click OK to accept changing all records
- input 'NRFUS' to the Member Firm field (without changing anything else)
- click Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:53 AM
i far prefer a list edit/update all over running a background script in prod!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 07:52 AM
var mu = new GlideMultipleUpdate(table_name);
mu.setValue('field_name', value);
mu.execute();