- 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 06:09 PM
so if i copy your exact statement but populate project_id (which is my field) it will error saying current is a null object reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 07:03 PM
Updated the original post for more context.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 07:36 PM
I also submitted a HI Case
Subject: Related List Reference Qualifier "current" object is null
Description: Reference Qualifiers "current" object is null for Related List "edit..." This should be populated with the current record.
Steps to reproduce:
Create a reference or a list reference in "Table A" to "Table B"
Create an Advanced Reference Qualifier script to have javascript: gs.error("asd" + current);
Add a Related list in Table B Form
Click "edit..."
Open Error Logs Filter to "asd"
You should see "asdnull"
Impact: 1 - High
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 10:28 AM
Hi Kyle,
I'm seeing a similar issue in my environment. Did HI support have a solution for you?
- 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