- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2021 11:55 AM
Hello,
I have a quick question. I created a List UI Action. This UI Action uses glideajax and a script include to grab the selected records from incident table and update a record on a different table. My question is, I want to also make this UI action in the Form view. Would I have to create a separate UI Action for the Form view, or is there something I can do to allow it to work on both views?
***EDIT***
List UI Action will check selected records
Form UI Action will check current record
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2021 01:37 PM
Try this:
// Call this function from the Onclick field
function myOnClickFunction() {
var SysId;
if (typeof g_sysId != 'undefined' && g_sysId) {
// if it is a List Context Menu action
SysId = g_sysId;
} else if (typeof g_list != 'undefined') {
// if it is a List Choice action
SysId = g_list.getChecked();
} else {
// if it is a Form action
SysId = g_form.getUniqueValue();
}
// convert into an array
SysId = SysId.split(',');
// and loop through the records
for (var i = 0; i < SysId.length; i++) {
// do something here...
}
}
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2021 01:37 PM
Try this:
// Call this function from the Onclick field
function myOnClickFunction() {
var SysId;
if (typeof g_sysId != 'undefined' && g_sysId) {
// if it is a List Context Menu action
SysId = g_sysId;
} else if (typeof g_list != 'undefined') {
// if it is a List Choice action
SysId = g_list.getChecked();
} else {
// if it is a Form action
SysId = g_form.getUniqueValue();
}
// convert into an array
SysId = SysId.split(',');
// and loop through the records
for (var i = 0; i < SysId.length; i++) {
// do something here...
}
}
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 08:38 AM
Sorry for the delayed response. This worked! Had to modify my script include a bit, but finally got it working.
Thanks again!