- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 05:12 AM
@Teja3- You will have to create this UI Policy from cmdb_ci_computer table and dot walk from Asset field which is already mapped to alm_asset related record.
See snip below.
Result -
Let me know if it worked!
Regards,
Vikas K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 05:21 AM
so on cmdb_ci record you want some fields to be read-only if the Hardware record is with State as Missing?
you can use display business rule on cmdb_ci_computer table and get the state of asset and store in g_scratchpad variable
Display BR:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if (current.asset.state.toString() == '8')
g_scratchpad.makeReadOnly = 'true';
else
g_scratchpad.makeReadOnly = 'false';
})(current, previous);
Then use onload client script on cmdb_ci_computer table and use that scratchpad variable
function onLoad() {
if (g_scratchpad.makeReadOnly == 'true') {
g_form.setReadOnly('assigned_to', true);
// add other field also
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 04:09 AM
Thanks for your solution.
Actually not only on cmdb_Ci_computer table in the alm_hardware table where we have current ci field which is reference to the other table in that we need to set read only for some fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 06:20 AM
Thank you for marking my response as helpful.
I believe I answered your original question where you want to make fields on CI table readonly based on Assets->State (Missing)
If you want to make fields readonly on Hardware table itself then it's simply UI policy on hardware table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 10:59 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 || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader