How to hide the field(Install status) from the respective class like (cmdb_ci_server) on change form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:01 PM
Hi
I have requirement like on change request form having CI class field which contains classes like cmdb_ci_server,cmdb_ci,netgear,cmdb_ci_business_app and we have one more field name called Change lookup this field contains all the fields of the respective classes for example if you select CI class name as cmdb_ci_server then in the change lookup will contains all the fields of the class cmdb_ci_server so now I want to hide one field(Install status) from that change lookup when user selects the CI class as cmdb_ci_server. How can I build this functionality for your refernce am attching the screenshot for the same.
Need to hide that red colour one Install status from that change lookup field when the select the CI class as cmdb_ci_server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:25 PM
Hi @raj99918
You need to create before query business rule for this requirement.
- 1. Create a before query Business Rule:
- Navigate to the system defination >business rule.
- Click "New" to create a new Business Rule.
- Set the table to "Change Task" (or the specific table where you're seeing the lookup field).
- Select "befoe query" for the action type.
- Set the "When" condition to "t
- 2. Add the business rule script:(function executeRule(current, previous) {
if (current.u_ci_class.getLabel() == 'cmdb_ci_server' && current.u_ci_class != null) {
current.u_ci_install_status.setValue(-1); // -1 is a default value to hide the option
}
})(current, previous);Click submit and testKindly mark my answer as helpful and accept solution if it helped you in anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 10:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 08:14 PM
I couldn't find these 2 fields on CHG form
Seems those are custom one?
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-24-2025 09:51 PM