How do dependent reference fields work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2016 04:27 AM
I'm trying to have a reference field dependent on another field... in Express... Sounds pretty trivial, but this is Express we're talking about, so it isn't working as expected. Therefore, I'd like to understand how dependent reference fields work.
Specifically, I'd like to have a CI reference field dependent on Caller on the Incident form, so I would have a list of CI items assigned to the caller. Obviously the first thing I had done, was to make the field dependent on caller_id. This didn't work and returned empty lists.
I started reading Make a field dependent and there I read:
"If a required dependency does not function as expected, as might happen if there is a many-to-many relationship between the fields, consider using reference qualifiers to accomplish the goal."
So I turned to reference qualifiers, just to be disappointed. In Express you cannot use advanced qualifiers and you cannot define your own dynamic qualifiers (the only available one is "CI Model Qualifier"). Therefore, I tried using the simple qualifier "is (dynamic)", but you cannot specify your own dynamic filters. The only available choices are "Me", "One of my Assignments" and "One of my Approvals".
So before giving up complete, I would like to know how dependent reference fields work. CIs have many user fields, but I want it to filter on assigned_to specifically. Originally, I expected the dependency to check all user fields in CI, but that does not seem to be the case.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2016 07:30 PM
Reference qualifier from a Script includes that queries the cmdb_rel_person (table that has user relationships out of the box) based on the caller. So gliderecord query on cmdb_rel_person.
Does it trigger any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 01:23 AM
Script fields (script includes, advanced BRs, etc) are not available in Express, so unless you could inline the code in the simple reference qualifier field, it wouldn't work. I tried to compare assigned_to with javascript:current.caller_id and javascript:current.caller_id.toString(), but those didn't work. To be honest, I have too little experience with the SNOW API to really know what I'm doing atm. Should really look into that asap.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2016 11:21 PM
Hi Peter,
Try this:
- Go to your dictionary entry for the cmdb_ci field on [task].
- Scroll to the bottom and click "New" on the Dictionary Overrides related list.
- Select "Override reference qualifier"
- Enter the following in the "Reference qualifier" field:
javascript:"assigned_to=" + current.caller_id.toString()
Hopefully you can do this in Express, I have no experience with it. But this works in a regular instance.
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 01:49 AM
The only related list available is "Labels", so that wont work either. I can't modify the reference qualifier field either. I tried entering "javascript:current.caller_id.toString()" with a simple qualifier and that changed the type to an advanced qualifier, with the reference qualifier field set to "assigned_to=javascript:current.caller_id.toString()". Obviously, this didn't work either. It looks like it just might not be possible after all.
Edit: Unless, I finally understand how dependency between fields works. Making a user dependent on a company works, because there is only 1 Company field on the User record, but with CIs there are multiple User fields available. So not sure how SNOW decides which fields it takes to be dependent on.