What are ActionUtils?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2009 02:28 AM
What exactly do the following lines of code do? I've seen them in a number of places and in particular in an the UI Action for Update buttons.
var au = new ActionUtils(); au.postInsert(current);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2009 05:19 AM
Have you looked at 'System Definition', 'Script Includes'?. ActionUtils comes from there. It's a set of utility functions for UI actions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2014 11:59 PM
To add to Mark's point, it is a library in a Script Include. They are various utility functions to assist the execution of action scripts.
They assume the existence of an "action" global variable pointing to an instance of Action.java
In your example. Current is being passed in to use the sys_id of the current form.
gs.include('ActionUtils');
var au = new ActionUtils();
au.<doSomething>"
There is more code than this, but this is what is being called in your example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2015 03:37 AM
Hi,
When we are trying to override submit ui action in scoped application, it is unable to find action variable.
It is giving below error.
org.mozilla.javascript.EcmaError: "action" is not defined.
Caused by error in Script Include: 'ActionUtils' at line 14
11: if (gr.isActionAborted())
12: return;
13:
==> 14: var linkedM2MTable = action.get('sysparm_link_collection');
15: if (linkedM2MTable)
16: this._insertM2M(linkedM2MTable, gr.sys_id);
Please help me on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
have you found solution for this problem?