How To find active & inactive Records in incident table

Kishore8
Kilo Guru

Below Mentioned Code not working.......why can i have calrification about this.

8.1 addActiveQuery

public QueryCondition addActiveQuery()

Adds a filter to return active records.
Returns:
QueryCondition - filter to return active records.
Example:
var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.query();

addInactiveQuery

public QueryCondition addInactiveQuery()

Adds a filter to return inactive records.
Returns:
QueryCondition - records where the active flag is false.
Example:
var inc = new GlideRecord('incident');
inc.addInactiveQuery();
inc.query();
10 REPLIES 10

Abhigyan1
Kilo Explorer

This will shw you the active records of the incident with the caller name and his email id.

var inc = new GlideRecord("incident");


inc.addEncodedQuery("active",true);


inc.query();

 

while(inc.next()){


gs.print(inc.number);
gs.print(inc.caller_id.getDisplayValue());
gs.print(inc.caller_id.email);

}