getRowCount() is for server side , what if I want through client side?
getRowCount() is for server side , what if I want through client side?
Working Code Answered question October 15, 2023
Use Glideaggregate with GlideAjax to get Count
Client Script var ga = new GlideAjax('MyCustomAjax'); ga.addParam('sysparm_name', 'helloWorld'); ga.addParam('sysparm_hoge', g_form.getValue("email")); // When you want to pass a value ga.getXMLAnswer(callback); function callback(answer){ var getanswer = answer.evalJSON(); g_form.addInfoMessage(getanswer.var1); //Display "Hello" g_form.addInfoMessage(getanswer.var2); } Script Include var MyCustomAjax = Class.create(); MyCustomAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, { helloWorld: function() { var count = new GlideAggregate('incident'); count.addAggregate('COUNT'); count.query(); var incidents = 0; if (count.next()) { return count.getAggregate('COUNT'); } }, type: 'MyCustomAjax' });
getRowCount() is for server side , what if I want through client side?
Working Code Answered question October 15, 2023