- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:40 AM
I have a related list that I am trying to get working from the *clcl_devices table (from connected workspace app) - to the relationships table (cmdb_rel_ci). - to show parent computers. As a test Ive hardcoded the sysid of the *clcl_devices device into the script and it works. However when I try to use current.sys_id to pull the *clcl_devices table sys id it doesnt work (the log shows no value)
Why would the script not be able to pull current.sys_id?
See the attached image for a screenshot of the query
*The community doesnt like that word so I had to put in an abbreviation.
Can anyone help?
Also my second question would be, in a related list how hard would it be to have the edit functionality in the list so that you can select and scroll from the list itself? The current list is just showing a new button
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:50 AM
Use parent.sys_id to get the sys ID of the record on the form. Current in the script represents rather the query for records to be shown in the related list. (Answering shortly from my mobile, if needed, I could provide an example script later).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 08:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 06:57 PM
No worries.
As per new community feature you can mark multiple responses as correct.
I believe I also answered your question and also the other part where you asked Edit button to be show. I shared explanation why it can't be shown
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 06:57 PM
No worries.
As per new community feature you can mark multiple responses as correct.
I believe I also answered your question and also the other part where you asked Edit button to be show. I shared explanation why it can't be shown
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:02 PM
Ok. It should show as accepted now. Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:52 AM
On line number 9, the parent sys_id doesn't look like a valid sys_id to me. Please verify.
Also, on line number 13, a variable query_string was declared but was not initialised.
please fixed it as follows.
var query_string = '';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 07:57 AM
That hardcoded sysid I changed just for this post, thats not the issue. Line 13 also not the issue. Now removed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 08:10 AM
when you use defined relationship
current object - refers to Queries from table
parent object - refers to Applies to Target table
update line 6 as this to get the clinical device sysId
var parent_sysid = parent.sys_id;
for defined relationship it doesn't show Edit button and is known behavior.
Since defined relationship has custom query so system won't know what/which relationship you are editing.
That's the reason even if you try to Configure List Control and see the Omit Edit button is greyed out.
This KB mentions the same
The New or Edit button does not appear on a one-to-many related list
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader