- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi All,
when user click ui action, I want to retrieve the sysids selected in the list view of workspace. g_list.getchecked is not working. In Below script alert message is not firing
Thanks in Advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hello @Sachin G K1 ,
just refer this code :
function onClick()
{
var data=g_list.getChecked();
alert(data)
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hello @Sachin G K1 ,
Just for testing can you please remove that parameters from function parenthesis. Then simply check is it working or not .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hello @Sachin G K1 ,
just refer this code :
function onClick()
{
var data=g_list.getChecked();
alert(data)
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Yes, now i am getting sysids. But why not earlier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hello @Sachin G K1 ,
This might happen due to that parameters . Im glad you query is resolved 😀 . If my response helps you then mark it as helpful and accept as solution. This will helps further future queries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
The issue is that `g_list` isn't available in workspace/UI Builder context like it is in classic UI. Workspace uses a different client-side API.
For workspace list views, you need to use the `snCustomEvent` API to get selected records:
```javascript
// In your UI Action client script
var selectedRecords = [];
snCustomEvent.fire('sn-list-get-selected-items', {
callback: function(items) {
selectedRecords = items;
if (selectedRecords.length > 0) {
alert('Selected records: ' + selectedRecords.length);
// Your logic here
} else {
alert('No records selected');
}
}
});
```
Alternatively, if you're working with a declarative action in App Engine Studio, you might need to handle this server-side instead. Create an action that expects the selected records as input parameters - the workspace will automatically pass them when multiple records are selected.
The key thing to remember is that workspace uses Angular components, not the legacy `g_list` object that's only available in the classic list view.
**If you find my answer useful, please mark it as Helpful and Correct. 😊**

