Skip to content

Instantly share code, notes, and snippets.

@johncaruso
Created October 14, 2018 20:30
Show Gist options
  • Select an option

  • Save johncaruso/0fd321bf0061e290b7a1e504ce2c5561 to your computer and use it in GitHub Desktop.

Select an option

Save johncaruso/0fd321bf0061e290b7a1e504ce2c5561 to your computer and use it in GitHub Desktop.
Fixes calculated field values where calculated field values were added/changed after records were inserted
/**
* Fixes calculated field values where calculated field values were added/changed after records were inserted
*
* @param {string} tableName
*/
function fixCalcField(tableName) {
var gr = new GlideRecord(tableName);
gr.query();
while (gr.next()) {
gr.setForceUpdate(true);
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment