Illegal access to getter method getMessage in class org.mozilla.javascript.RhinoException

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2019 06:12 AM
Dear All,
One of the custom script in Workflow is throwing the error in Workflow Context as *Illegal access to getter method getMessage in class org.mozilla.javascript.RhinoException*.
The objective of this Workflow activity is to push Group-Approvals.
Following is the code snippet which shows the execution path -->
Group-Approval activity :
if(current.variables.appl){
var arr=[];
var rec_arr=[];
arr.push(current.variables.appl);
rec_arr=new SCUtils(current).getApplicationApprovals(arr); //Script Include to call the required group
for(var i=0;i<rec_arr.length;i++){
answer.push(rec_arr[i].toString());
}
Script Include :
getApplicationApprovals: function (application) {
var arr = [];
var groups = [];
var app_nv = [];
for(var j=0;j<application.length;j++){
app_nv.push(application[j]);
}
for(var i=0;i<app_nv.length;i++){
var record = new GlideRecord('cmdb_ci_appl');
record.addQuery('sys_id',app_nv[i].toString());
record.query();
if(record.next()){
groups.push(record.approval_group.toString());
}
}
return groups;
},
Please let me know any suitable modification , if any.
Best Regards,
Puru
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2021 10:33 AM
I found it happened to me when I tried to .push to an array I had not declared. For example:
answer.push(sys_id);
gives the error if you have not declared answer as an array earlier in the code. This is a working example:
var answer = [];
answer.push(sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 04:46 AM
Helped me in one go!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2024 12:39 PM
I know this is old ... but in my case I had a true/false field named "default" in a scoped app. I got this exact error when checking for the condition "gr.default" in an IF statement. Seems the "gr.default" is a protected column as it shows up in blue, which I did not notice at first.