Skip to content
Merged
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 advisable to validate the row count the //gr.getRowCount() and remove from codebase.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var GrQry = ""; //Query of the affected records.

var grTableName = new GlideRecord('table_name');
grTableName.addEncodedQuery(GrQry);
grTableName.query();
{
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();
}
gs.print("Records updated successfully");
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();

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();
}
gs.print("Records updated successfully");
Loading