getActionName()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2011 07:27 AM
Is there a way to determine this?
I found a small "script" in the wiki that generates an output. I just wanted to know if there's a naming convention in this.
e.g. my table is name
something_tasks
and i want to simulate the same behaviour I have in my incident form, where the "close" button just diplsays the fields for close notes etc.
There there seems to run a client script which returns false and it checks for this action name....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2011 08:34 AM
Can you clarify a bit? I'm not sure exactly what you're asking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2011 11:14 PM
What I want to do is:
When closing a task (an own application) via a UI-Action I want to set a state, which then triggers a ui action to unhide two mandatory fields. I then want to "abort" closing. So that the user can enter close notes. After this he presses update and the taks is closed.
There's a similar thing implemented with the resolve incident functionalit..
There's a UI action:
Condition:
(current.incident_state < 6) && (gs.hasRole("itil"))
Script:
current.incident_state = 6; // resolved state
if(current.isValidRecord()) {
// this is when close is called as an update, just update it
current.update();
} else {
// and insert the record
current.insert();
}
The incident state then triggers the UI policy to display the fields close notes and close code. These fields are mandatory.
and then there's a client script.
function onSubmit() {
var action = g_form.getActionName(); // this seems to read some information about WHAT is done
var state = '6';
if(action == 'close_incident') // how does this get determined? I mean. This is to compare with the actual action.
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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2011 03:20 AM
nevermind.
i found the place, where I can define the action name. Must've been blind or something.
regards
Christian