ServiceNow adding your own function to GlideForm (g_form)
for example, onChange client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
g_form.connectorChange(newValue, isLoading);
}
the function is defined in another global, onload client script:
self.g_form.connectorChange = function(newValue, isLoading) {
try {
if (isLoading) {
setConnectorFields();
} else {
var environmentGA = new GlideAjax("x_cls_clear_skye_i.IGASetupAjax");
environmentGA.addParam('sysparm_name', 'getConnectorSettings');
environmentGA.addParam('sysparm_id', newValue);
environmentGA.getXMLAnswer(function(answer) {
g_scratchpad.IGA.Connector = JSON.parse(answer);
setConnectorFields();
});
}
} catch (e) {}
};
Comments
Post a Comment