Quantcast
Channel: ServiceNow Community - Development & Integration
Viewing all articles
Browse latest Browse all 423

Query for empty table

$
0
0

Hi

I need the sys_ids from table 'service_offering' that have no entry in the related table 'service_subscribe_company' (m2m relation).

I tried the following:

// Seek active services without subscribtion
var ysys = '';
var gr1 = new GlideRecord('service_offering');
gr1.addQuery('u_active', true);
gr1.addNullQuery(service_subscribe_company); //(--> here is the Problem!)
while (gr1.next()) {
if (ysys != '') {
ysys += ',' + gr1.sys_id.toString();
} else {
ysys = gr1.sys_id.toString();
}
}

of course it doesn't work ...

read more


Viewing all articles
Browse latest Browse all 423

Trending Articles