- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:14 PM
We are trying to use an advanced reference qualifier for our M2M references to filter to specific "hardware". From reading the forums it looks like "parent" and "current" exists; however, when I do a javascript:gs.error("asd" + parent); I get
org.mozilla.javascript.EcmaError: "parent" is not defined.
Caused by error in sys_dictionary.475b474879f110107f613a6fa3b72983 at line 1
==> 1: gs.error("asd"+ parent);
and when i do a javascript:gs.error("asd" + current); i get
asdnull |
What can i do to dynamically filter based on parent or the current record?
Edit for my context:
I have a table called POAM and a table called Hardware. I created a many to many between the 2. On the POAMs form, I have added a related list. When you click edit we are wanting it to show a filter list of hardware.
So in the many to many table, I am editing a reference qualifier for hardware. for testing I am only printing out logs because nothing was working (and it ended up being because current was null). So i added javascript:gs.error("asd" + current);. I then go to the poams table, and click "edit..." on the hardware related list. This should kick off the reference qualifier script (in does) and when i review the logs i get asdnull. So current is null when coming from a related list. Also, parent is not a defined object at all...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 10:37 AM
Solution proposed is : Hello Kyle, We are placing this case in Solution Proposed, based on the following information. Issue Summary: Related List Reference Qualifier "current" object is returning null Solution Proposed: The behavior you are seeing here unfortunately is expected. Using Advanced Reference Qualifiers containing 'current' with List Collector type variables is not currently supported as the value for current could change and cause unexpected results. Please see the following knowledge article for more information. https://hi.service-now.com/kb_view.do?sys_kb_id=3f807eaedb7e2f009540e15b8a961961 Next Steps: If you feel I addressed your questions properly and provided relevant information that resolved the issue, please accept the solution and close this case. Otherwise, if you have a moment, you may call me or provide additional information in this case so we may further discuss this issue. Thank you, Jeff Menkel Office: +1 407-499-2550 ServiceNow | Works for you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 04:55 PM
Hi Kyle,
Can you please give some more details on the filter you need. Sharing visuals would be great idea if you don't mind.
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 05:51 PM
If you go to any reference field and choose an "advance qualifier" and just type javascript:gs.error(current.any_field); i get an error that the "current" object is null... If I try to use the same thing for the "parent" object, it is not defined.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 06:15 PM
Current is a valid object in the advance reference qualifier and it should not be null. Also, gs.error() must log an error message with field value. See screenshot below for reference. I pass in incident number and log an error its work as expected.
Can you tell me exactly where you are using this reference qualifier? Service catalog variable or Standard reference field?
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 06:57 PM
When I do javascript:gs.error("asd" + current); i get asdnull
so my issue is the current object is null... Are you doing this on a related list?