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

Chuck Tomasi
Tera Patron

Hi,



Can you provide some additional details on what you are trying to accomplish? Details (table names, catalog items, etc) are encouraged. Screen shots are always appreciated.


How to set Field values " script include to client side" when form   Load

This question is Not Answered.(Mark as assumed answered)


Visitor



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.


I'm not sure I completely understand the use case since it will set those values for every single incident on form load, but if that's what you want, the client script should do the trick (assuming state, category, and short description are all on the form.) No script include needed.



function onLoad() {


   


        g_form.setValue('state', '3');


        g_form.setValue('category', 'software');


        g_form.setValue('short_description', 'welcome to scripting');


   


}


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Please share more info. I can confirm code mentioned as per the wiki should work.