Skip to content

Commit aa2b0f4

Browse files
authored
Create update_multiple_records.js
1 parent 47eda07 commit aa2b0f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var GrQry = ""; //Query of the affected records.
2+
var grTableName = new GlideRecord('table_name');// update table_name ex. incident
3+
grTableName.addEncodedQuery(GrQry);
4+
grTableName.query();
5+
//gs.addInfoMessage(grTableName.getRowCount())
6+
{
7+
grTableName.setValue("field", "value"); // Replace 'field' and 'value'
8+
grTableName.autoSysFields(false); // Prevents updating system fields like 'updated by'
9+
grTableName.setWorkflow(false); // Prevents triggering workflows
10+
grTableName.updateMultiple();
11+
}

0 commit comments

Comments
 (0)