Invalid query detected, please check logs for details [Unknown field item in table sc_req_item]

DEV 1
Tera Contributor

Invalid query detected, please check logs for details [Unknown field item in table sc_req_item]

this error is shown as warning in logs, how to debug this

schedule script is not working

9 REPLIES 9

Still not working

 

In EVENT logs I get

login.failed

Don't see so quickly anything that has to do with that.

Have you tried adding debugging to your script? To see up to which point the script is working, from which point it isn't? Also adding debugging to see if variables etc contain the values you would expect. That would shorten your search immensly.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Checked 

var rec = new GlideRecord('sc_req_item');
rec.addQuery('assignment_group', '0cfdca83db521bc0babf79fdae9619f9'); // SP Materials Management
rec.addQuery('u_export_state', 'ready for export');
rec.addQuery('item', '4514ea12db481c104f545e38dc9619b5'); // ENVI Item Add Form
rec.query();
while (rec.next()) {
    gs.info("this is for test"+"  "+rec.number);
    var a = '';
    var loc = new GlideRecord('cmn_location');
    loc.addQuery('sys_id', rec.variables.dv_location);
    loc.query();
    while (loc.next()) {
        var location = loc.u_financial_code;
        var master = location;
        if (location == '552-0000') {
            master = 'Master';

 

code is not  able to query the record in this schedule script

 

but when i copied same code in fix script and run fix script as admin

it works fine

suvro
Mega Sage
Mega Sage

You can go through the below thread. It may help you

 

https://community.servicenow.com/community?id=community_question&sys_id=e3468007dbf990502737e15b8a9619df