com.glide.script.RhinoEcmaError: "readOnly" is not defined - ERROR

Suresh11
Tera Contributor

When running the below script I am getting an error on the logs:

 

com.glide.script.RhinoEcmaError: "readOnly" is not defined.
<refname> : Line(1) column(0)
==> 1: readOnly

 

The code is looping through but the records are not deleted. Appreciate any help with this.

 

var redactJournal = new GlideRecord('sys_journal_field');
redactJournal.query('element_id', caseGr.sys_id);
redactJournal.query();
while (redactJournal.next()) {
gs.info('Journal 111 updated/deleted');
// redactJournal.setValue('value', 'Data Redacted');
// redactJournal.update();
redactJournal.deleteRecord();
}

7 REPLIES 7

Suresh11
Tera Contributor

Script is not on Global scope, Would this cause an issue deleting journal entries?

Ankur Bawiskar
Tera Patron
Tera Patron

@Suresh11 

Did you try adding logs and verify?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Suresh11
Tera Contributor

Hi Ankur,

 

Where should I put the log statements? The log i have inside the journal entries deletion proves it is looping through as expected but doesn't delete the records. Thanks