Where can I find docs for "sys_action"????

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2009 04:55 AM
I am trying to do some client scripting, specificly making some fields manditory when you close an Incident. I found a sample script in the Wiki but it does not work. The reason it does not work is because sys_action.value returns bbddb6bbc0a81823adf328cbbba or something like it and the script is looking for "incident_close". So I am looking for documentation of what sys_action is supposed to do, it properties and any methods it may have.
The Wiki is very lacking in this area.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2009 08:36 AM
Can you post the script that you are developing?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2009 08:53 AM
It was a sample script in the Wiki and it did not work because of what the sys_action was returning.
function onSubmit() {
var form = gel('incident.do');
var sClsBtn = form.sys_action;
var inc_state = g_form.getValue('incident_state');
alert(sClsBtn.value);
if (sClsBtn.value == 'close_incident' || inc_state == '6' || inc_state == '7') {
var close_note=g_form.getValue('close_notes');
if (close_note == '') { ''
alert('Close Notes are mandatory!');
g_form.setMandatory('close_notes', true);
return false;
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2009 10:08 AM
Try this script.
function onSubmit() {
// get the name of our form
var formName = g_form.tableName + ".do";
// get the form
var form = gel(formName);
var action = form.sys_action.value;
var state = '6';
if(action == 'close_incident'){
state = '7';
}
if(action == 'close_incident' || action == 'resolve_incident'){
g_form.setValue('incident_state',state);
g_form.setDisplay('close_notes',true);
g_form.setDisplay('close_code',true);
g_form.setMandatory('close_notes',true);
g_form.setMandatory('close_code',true);
if (g_form.getControl('close_notes') && g_form.getControl('close_code'))
if(g_form.getValue('close_notes') == '' || g_form.getValue('close_code') ==''){
return false;
}
}
}