
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 06:49 PM
So I have created a UI Action, the idea is when a button is clicked on an asset form a modal window will appear with only the required fields via a particular view I have created, however when I click the button nothing at all happens, not even an entry in an logs that I can find. I'm guessing it is something pretty simple, but can't see the cause for the life of me.
The buttons shows correctly:
The view created is called "Returned"
The UI Action is:
Name: Return Asset
Table: Asset {alm_asset} (Have also tried alm_hardware, same result)
Oder: 100
Application: Global
Action Name: BLANK
Active: checked
show insert: checked (also tried unchecked same issue)
Show Update: checked (also tried unchecked same issue)
Client: checked
List v2 compatible: checked (also tried unchecked same issue)
Form button: checked
Form style: Unstyled (have also tried none, same issue)
Onclick: showReturnForm()
Script:
function showRetunForm(){
//Get the table name and sys_id of the record
var tableName = g_form.getTableName();
var sysID = g_form.getUniqueValue();
//Create and open the dialog form
var dialog = new GlideDialogForm('Return Asset', 'alm_asset'); //Provide dialog title and table name
dialog.setSysID(sysID); //Pass in sys_id to edit existing record, -1 to create new record
dialog.addParm('sysparm_view', 'Returned'); //Specify a form view
dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists
dialog.render(); //Open the dialog
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 07:18 PM
It would appear I had some sort of typo in the onclick text, when I copied and pasted it from the script into the onclick field and retested, all is now working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 07:18 PM
It would appear I had some sort of typo in the onclick text, when I copied and pasted it from the script into the onclick field and retested, all is now working