Is it possible to show a custom modal from list view in agent workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2021 08:21 PM
I know we can edit multiple items from the list in Workspace. Is it possible to show a modal in the list view in the agent workspace? In below if I click on Escalateee, I want to open a modal view and send the input from modal to some script which process it.. Also is it possible to edit the Fields in the Edit button?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2025 05:53 AM
Hello @Sameer15
Yes, it is possible to show a custom modal (like a Yes/No or informational dialog) in List view using a Client Script.
✅ Solution:
Ensure that the "Isolate Script" flag is unchecked in the client script configuration. This is required so that the script can access and manipulate the DOM to display the modal.
Use the following onCellEdit client script to display a modal when a specific field is edited and prevent the list edit from being saved:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) { try { if (newValue) { // Show modal message and prevent save cancelDialog(function () { callback(false); // Don't save list edit }); } } catch (err) { console.error('Error in onCellEdit client script: ' + err.message); callback(false); } } function cancelDialog(callback) { var dialog = new GlideModal(); dialog.setTitle('Action Not Allowed'); // Assign unique callback to window scope window.__dialogCallback = function () { dialog.destroy(); // Close the modal callback(); // Notify to stop list edit delete window.__dialogCallback; // Clean up }; dialog.renderWithContent( '<div style="padding:20px; font-size:14px;">' + '<p><strong>Lifecycle State</strong> and <strong>Lifecycle Stage Status</strong> must be updated together from the form. List editing is not allowed.</p>' + '<div style="text-align:right; margin-top:20px;">' + '<button class="btn btn-primary" onclick="window.__dialogCallback()">OK</button>' + '</div>' + '</div>' ); }
I implemented this approach to prevent inline editing of lifecycle-related fields on the Asset, Contract, and Install Base Item tables. Since the Sold Product table does not contain lifecycle fields, the script was not added there.
If this helps resolve your query, please accept the answer and mark it as helpful.
Best Regards,
Siddhesh Jadhav