var query = Class.create();
query.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
querytable_info: function(){
var result=this.newItem("result");
var applyername = this.getParameter('sysparm_getName');
var gr=new GlideRecord('x_178251_my_applic_bigproject');
gr.addQuery('name',applyername);
gr.query();
while(gr.next()){
result.setAttribute("q_mid",gr.mid);
}
var answer;
var m_id = this.getParameter('sysparm_getId');
var list="";
var gm=new GlideRecord('x_178251_my_applic_mproject');
gm.addQuery('id',m_id);
gm.query();
while(gm.next()){
answer=this.newItem("ans");
answer.setAttribute("q_name",gm.name);
}
},
type: 'query'
});
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } var sname=g_form.getValue("bigproject"); var ga=new GlideAjax('query'); ga.addParam('sysparm_name','querytable_info'); ga.addParam('sysparm_getName',sname); ga.getXML(showDescription); function showDescription(serverResponse){ var result=serverResponse.responseXML.getElementsByTagName("result"); var b_mid=result[0].getAttribute("q_mid"); //alert(b_mid); ga.addParam('sysparm_getId',b_mid); ga.getXML(callback); function callback(response){ var m_name=''; var answer=response.responseXML.getElementsByTagName("ans"); g_form.clearOptions("mPro"); for(var i=0;i<answer.length;i++){ m_name=answer[i].getAttribute("q_name"); g_form.addOption("mPro",m_name,m_name); } } } //Type appropriate comment here, and begin script below }