Not applicable

Thanks Tony!!

what are the results of your debugging\testing? -- In the alert we are getting old value of category

what exactly is\is not working? - if we change category to software in the list and sub category changes to email then record should not submit to server. Script should check is it category is software or not, if yes, then the record should abort.

 

On cell edit Client script:

Field name: Sub category

Script:

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('incidenttTable');
ga.addParam('sysparm_name', 'tablequery');
ga.addParam('sysparm_syssid', sysIDs);
ga.addParam('sysparm_newvalues', newValue);
ga.getXML(myid);

function myid(response) {

var answer = response.responseXML.documentElement.getAttribute("answer");
alert('ramya' + answer);
if (answer == 't1')
if (newValue == 'email')
alert('anns' + answer);
saveAndClose = false;

}
callback(saveAndClose);
}

 

Script Include:

var incidenttTable = Class.create();
incidenttTable.prototype = Object.extendsObject(AbstractAjaxProcessor, {
 
    tablequery: function() {
        var sysid = this.getParameter('sysparm_syssid');
        //var managername = '';
        var empname = new GlideRecord('incident');
        empname.get(sysid);
        empname.query();
        if (empname.next()) {
gs.addInfoMessage('category' + empname.category);
            var state = empname.category;
        }
        var catgory;
        if (state == 'software')
gs.addInfoMessage('category inside' + empname.category);
            catgory = 't1';
        return catgory;
    }
});
 
Thanks in advance!!