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
09-19-2019 02:27 AM
Hi Puru,
Is that a custom script include?
SCUtils
can you check below links?
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 04:50 AM
Apply canRead or use GlideRecordSecure, ACL might be an issue here.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 01:48 AM
Did you find any solution to the error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 10:16 AM
For what its worth anyone coming across this thread, I was getting this error and it happened to be that I had a typo when calling new GlideRecord('my_table_name'), where I had just simply typed 'my_table_name' incorrectly, but the linting and error didnt really lead me in the right direction.