I've the following in a SI
var serviceAsset=new GlideRecord('u_service_asset');
serviceAsset.addQuery('u_service',service_sys_id);
serviceAsset.addNotNullQuery('u_parent');
serviceAsset.query();
gs.log(serviceAsset.getEncodedQuery());
This prints the following in the logs
u_service=305baa6fdb17d0d44bb6e126059619e1^u_parent!=NULL^sys_idNotValidnull^ORsys_idNotValidnull
What does sys_idNotValidnull
mean and why is it getting added as an OR condition?
I've a "Query" Business Rule on the table but that code doesn't seem to be referencing the above.
(function executeRule(current, previous /*null when async*/) {
var serviceassetquery;
serviceassetquery = current.addEncodedQuery("u_sourcesystem!=Wholesale^ORu_sourcesystem=NULL");
})(current, previous);
So the
sys_idNotValidnull^ORsys_idNotValidnull
part was being added by the Business Rule. And the reason for sys_idNotValidnull
presence was because the column u_sourcesystem
was NOT present on the table u_service_asset
Duh! It was an invalid column after all that caused all the issue.