Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Specialized Areas/Fix scripts/updateMultipleRecords/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//This Fix scripts is to clean up multiple record errors
// Navigate to Scripts-Background
// Past the script and update the place holder variable value: table name, field, and value etc.
// also after validating the row count the gs.addInfoMessage is commented out.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var GrQry = ""; //Query of the affected records.

var grTableName = new GlideRecord('table_name');
grTableName.addEncodedQuery(GrQry);
grTableName.query();
gs.addInfoMessage(grTableName.getRowCount())

{
grTableName.setValue("field", "value"); // Replace 'field' and 'value'
grTableName.autoSysFields(false); // Prevents updating system fields like 'updated by'
grTableName.setWorkflow(false); // Prevents triggering workflows
grTableName.updateMultiple();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var GrQry = ""; //Query of the affected records.

var grTableName = new GlideRecord('table_name');
grTableName.addEncodedQuery(GrQry);
grTableName.query();
gs.addInfoMessage(grTableName.getRowCount())// comment out after validating row count

while (grTableName.next()) {
grTableName.setValue("field", "value"); // Replace 'field' and 'value'
grTableName.autoSysFields(false); // Prevents updating system fields like 'updated by'
grTableName.setWorkflow(false); // Prevents triggering workflows
grTableName.update();
}
Loading