Reference Field Modal on incident on SOW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 08:29 AM
We'd like to default values on the filter for reference field "Configuration Item" model on incident form on SOW.
Example: ITIL user create an incident from SOW. They select the spyglass on "Configuration Item" field. The window pops up with filter and CI list.
We’d like to default “Select field” to Name, and “Select operation” to “contains”.
User just need to enter CI name and click “Run”.
Is it possiable? Where can I find the code for this reference modal?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 09:12 AM
try to open the incident form in from the ServiceNow.
find the client script associated with the "Configuration Item" reference field.
and try to implement following logic
function onChange_ConfigurationItem(control, oldValue, newValue) {
// Set default filter values
g_filter.addCondition('name', 'CONTAINS', '');
g_form.clearOptions('Configuration Item'); // Clear any existing options for a fresh search
g_form.getControl('Configuration Item').setFilter(g_filter);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:29 AM
Thank you for reply. it doesn't work adding the above code to incident. It may work by adding the code to the reference field Modal.