How To find active & inactive Records in incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 01:34 PM
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'); |
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'); |
- 8,081 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2017 03:53 AM
How to set Field values " script include to client side" when form Load
This question is Not Answered.(Mark as assumed answered)

D Kishore Mar 12, 2017 12:40 AM
Script Include :
var HelloWorld = Class.create();
HelloWorld .prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
Approve: function(a) {
return "The Server Says Hello " + this.getParameter('sysparm_user_name') + "!" ;
}
});
client Side OnLoad:
function onLoad() {
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('HelloWorld');
ga.addParam('sysparm_name','Approve');
ga.addParam('sysparm_user_name',"Bob");
ga.getXMLWait();
alert(ga.getAnswer());
}
i would like to set values
state=3,category=software, short_description=''welcome to scripting" i want to write this code in script include and i would like to call that server code when i load a form in client side, this values should set into field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 01:40 PM
FYI, that's only the 'setup' as an example of each - there's a little more two it if you want to get your hands on the records.
var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.query();
// This part goes through each active record
while (inc.next()) {
// do stuff to the record here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 01:50 PM
Sample script to return the count of active incidents.
var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.query();
gs.log('count of active incidents ' +inc.getRowCount());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 01:05 PM
Can you clarify what the objective is here? I'm not clear what the underlying requirement is that is driving this business rule. More information is always help. Please also include what version of ServiceNow you are using. There may be some changes to function name.
