Hardware Asset Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 05:28 AM
Hi All,
Requirement :
I want only specific attributes to be editable for certain user group on alm_hardware table. The attributes which i want to be editable are 'install_status', 'substatus', 'assigned_to', 'asset_function', 'work_notes'. Apart from this attributes rest all attributes should be greyed out and not editable. The users are updating the details of assets from Hardware Asset Workspace - Asset Estate - Hardware Assets.
Please can someone help me on the same and let me know if this can be done. As I tried a lot but not able to figure out how can i do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 09:19 AM
on form you can write onLoad client script on alm_hardware table and Display business rule
something like this
Display Business Rule
(function executeRule(current, previous /*null when async*/) {
// Check if the current user belongs to the specific user group
var userGR = new GlideRecord('sys_user_grmember');
userGR.addQuery('user', gs.getUserID());
userGR.addQuery('group.name', 'YOUR_USER_GROUP_NAME'); // Replace with your user group name
userGR.query();
g_scratchpad.isEditableUser = userGR.hasNext();
})(current, previous);
Client Script:
function onLoad() {
// Check if the user is in the specific user group
if (g_scratchpad.isEditableUser) {
// Make specific fields editable
g_form.setReadOnly('install_status', false);
g_form.setReadOnly('substatus', false);
g_form.setReadOnly('assigned_to', false);
g_form.setReadOnly('asset_function', false);
g_form.setReadOnly('work_notes', false);
// Make all other fields read-only
var fields = g_form.getEditableFields();
for (var i = 0; i < fields.length; i++) {
if (['install_status', 'substatus', 'assigned_to', 'asset_function', 'work_notes'].indexOf(fields[i]) === -1) {
g_form.setReadOnly(fields[i], true);
}
}
} else {
// Make all fields read-only for users not in the specific group
var allFields = g_form.getEditableFields();
for (var j = 0; j < allFields.length; j++) {
g_form.setReadOnly(allFields[j], true);
}
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 08:07 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 09:40 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 08:35 AM
I am noticing the limited Attribute updates allowable from the workspace view as well. Seems HAM Admin should be able to update any attribute from the Table view in Workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 11:03 PM
How to do that?