i have a reference variable on my catalog item named as selectserver and refer to…
- User
i have a reference variable on my catalog item named as select_server and refer to cmdb_ci_server table records and the records of cmdb_ci_server table further linked to another table records cmdb_rel_ci table via ip address relationship. i want that when i select any server and try to submit the form then it will check all records related to the server on cmdb_rel_ci table and check all records operational status field value. if the field is operational on cmdb_rel_ci table records then show a popup show that you cannot select because parent record operatioal status is operational and clear the field value and restrict the catalog form from submitting. i provide the script below for your understanding var relGlide = new GlideRecord("cmdb_rel_ci); var queryString = “type=d93304fb0a0a0b78006081a72ef08444^child.ip_address=” +current.variables.ip_address; relGlide.addEncodedQuery(queryString); relGlide.query();
- Assistant
- User
i need script include and on submit client script for the requirment above
- Assistant
- User
This script include and on change client script is working fine for my requirement. but i need to change both of them according to on submit client script and prevent the form catalog request submiision. At on change it will takes time to fetch the operational servers and form is been submitted by user. i need to change it on submit so that user not allow to submit the catalog request untill servers get checked . var Checkopstatus = Class.create(); CheckOpStatus.prototype= Object.extendsobject(AbstractAjaxProcessor, { getoperationalstatus: function(ip_address) { var result =[]; var relGr = new GlideRecord('cmdb_rel_ci'); var queryString = "'type=d93304fb0a0a0b78006081a72ef08444^child.ip_address=" + ip_ address; relGr.addEncodedQuery(queryString); relGr.query(); while (relGr.next()) { var parent = relGr.parent.getRefRecord(); if (parent && parent.operational_status == '1' ) { result.push(parent.name.toString()); } } return result; }, ajaxFunction_getParentNames: function() { var ip_address = this.getParameter('sysparm_ip_address'): var result2 = this.getOperationalStatus(ip_address); return JSON.stringify(result2); }, type: 'CheckOpStatus' });
- Assistant
- User
prevent form submission but cannot show alert
- Assistant
- User
not working
- Assistant