function deletechild(){ var c=confirm("Are you sure you want to delete the child incidents?"); if (c==true){ g_form.addInfoMessage("You have agreed to close the child incidents"); gsftSubmit(null,g_form.getFormElement,'deletechildincident'); } } gs.addInforMessage("Sys id of this incident record is"+current.sys_id); var gr= new GlideRecord('incident'); gr.addQuery('parent_incident',current.sys_id); gr.query(); while(gr.next()){ gs.addInfoMessage("Found a child incident to be deleted"); gr.state=7; gr.update(); } action.setRedeictURL(current);