How to get values from a watchlist and print maximum value in a field ?

Khushboo8
Tera Contributor

My requirement is that suppose there is watchlist named 'services' on a form in which multiple services from 'services' custom table can be added. Now the 'services' custom table has 'tier' field. So, whichever service in the watchlist has lowest tier that service's tier should display in 'Tier' field on the form ?

5 REPLIES 5

Hi Khushboo,



As Brad already pointed out, you need to pass on the value from client to server using g_form.getValue() and adding it to parameter



e.g



You need to pass on the incident number to script include via AJAX



You will write something like



var num = g_form.getValue('number');



var ga = new GlideAjax('scriptIncludeNameGoesHere');


ga.addParam('sysparm_name','functionNameWithinScriptInclude');


ga.addParam('sysparm_yourCustomParameter',num);


ga.getXML(callBackFunction);



You will find below useful to understand this



http://wiki.servicenow.com/index.php?title=GlideAjax#gsc.tab=0