Getting Error as :com.glide.script.RhinoEcmaError: Cannot convert null to an object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2021 06:43 AM
Hi All,
I have written one query business rule which helps to track the inactive users on different table .
It is creating lots of warning logs which is impacting the performance of the instance .
Scripts:
Business Rule: user query. It is on sys_user table
var checkField1 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("alm_hardware");
var checkField2 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("cmdb_software_product_model");
var checkField3 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("samp_sw_publisher");
if (checkField1 != -1 || checkField2 != -1 || checkField3 != -1) {
//do nothing
} else {
current.addActiveQuery();
}
Error Message:
om.glide.script.RhinoEcmaError: Cannot convert null to an object.
sys_script.62a7bfaf0a0a0a6500c49682bd82376a.script : Line(3) column(0)
==> 3: var checkField1 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("alm_hardware");
4: var checkField2 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("cmdb_software_product_model");
5: var checkField3 = GlideTransaction.get().getRequest().getHeader("referer").toString().indexOf("samp_sw_publisher");
6:
How can I modify the scripts which will not impact the performance of the instance .Please help me in this regard.
Regards,
Aquib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2021 08:57 AM
Hi Ankur,
If you could reply . It will be really helpful.
Regards,
Aquib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2021 10:05 PM
Hi,
I remember GlideTransaction giving lots of logs.
But is your functionality working fine?
Regards
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
‎10-25-2021 10:19 PM
Hi Ankur,
Yes . The functionality is working fine . Only issue with the logs .
Regards,
Aquib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2021 10:43 PM
then it should be fine.
Please raise HI ticket with ServiceNow on this.
Regards
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
‎10-25-2021 11:05 PM
Sure.