Related List Script not working

anfield
Tera Guru

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

3 ACCEPTED SOLUTIONS

Dominik Simunek
Tera Guru

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).

 

 

View solution in original post

Thanks. That works. parent.sys_id pulls the correct value

View solution in original post

@anfield 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

Dominik Simunek
Tera Guru

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).

 

 

Thanks. That works. parent.sys_id pulls the correct value

@anfield 

Did you mark your own response as correct?

Would you mind marking my response as correct as my post helped you?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks. That wouldve been a mistake. I clicked accept solution on Dominik's post as that was the first response