var inc= new GlideRecord('incident');
inc.addQuery('number', "INC0012323" );
inc.query();
if (inc.next()) {
if (inc.isValid()) // check whether the record is valid or not
return "Valid Record";
}
How to Determines if the current database record is valid or not ServiceNow