sysparm_dependent on Incident CI Search

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 02:57 AM
Hi,
I posted on this before but the issue has moved forward and I thought a fresh post to be better.
The default behaviour on the incident form (OOTB) is that the CI reference field is dependent on the company field. On a fresh form, the company field is blank and so the search URL for the CI field looks like this:
service-now.com/cmdb_ci_list.do?sysparm_target=incident.cmdb_ci&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=cmdb_ci&sysparm_reference=cmdb_ci&sysparm_view=sys_ref_list&sysparm_additional_qual=&sysparm_dependent=&sysparm_client_record=session&sysparm_domain_restore=false
If you select a company, the sys_id of that record is added to allow for the filter to be used.
On our instance though, despite everything being set the same (as far as I can see), the URL on a blank form looks like this:
service-now.com/cmdb_ci_list.do?sysparm_target=incident.cmdb_ci&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=cmdb_ci&sysparm_reference=cmdb_ci&sysparm_view=sys_ref_list&sysparm_additional_qual=&sysparm_dependent=undefined&sysparm_client_record=session&sysparm_domain_restore=false
The dependency works so if we select a company then the sys_id is added but it means that, on a fresh form, a search on the CI field returns nothing.
We've checked through all the onLoad scripts that kick in and tried disabling them one by one but the same behaviour occurs. We thought it might be down to the initial field focus going to the company field (whereas, on the OOTB form it goes to the incident number field). We thought this might be being seen as an entry of sorts even if noting is selected so we disabled field focus across the instance and still the same thing happens.
Does anyone have any ideas about what we can check please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 03:08 AM
Ha. Just fixed this.
For some reason, back at instance go-live, someone added a client script to set the company to the that of the caller. Obvisouly, on a new form, there is no caller yet and so the company was being populated with "null" which was being passed to the search as undefined.
Disabled the script, works a treat.
We've got another script that sets that the company field to that of the caller when the caller field is populated so no idea why they did that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2020 01:54 AM
Hi Andrew,
is there any way to remove sysparm_dependent="some sys_id" , after populating the record on dependent field? . Actually what is happening in my case, if user again clicks on parent field, it shows no record . It shows record only if value on dependent field is removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 03:14 AM
I am also facing same issue, but could not find any OOTB client scripts. Could you help me on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2024 09:02 AM
You can navigate to the Dictionary Entry of the Configuration Item field. Switch to Advanced view. Select Dependent Field tab and clear Dependent.
Another solution is to make sure the Company of the Caller and Configuration Item is similar.