Adding items to List field on GlideRecord
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2013 04:27 PM
Hello. I have a CI called "Virtual Server" and it has a field of type List of "Network Interfaces". During my import I would like to find the existing Sys IDs for the Network Interfaces and assign them to the server. I see how to set the value of a Reference field, but not a List field with a GlideRecord.
I'd like something like the following, but unless I've updated the Network Interfaces List on the CI manually it's always undefined:
var gr = new GlideRecord("u_cmdb_ci_virtual_server"); gr.initialize(); var sysIdsOfNetworkInterfaces = ["0c26899a6fe9510059fb186e6b3ee413","0eb7ac166f259100fb7f384aea3ee479"]; gr.u_network_interfaces = sysIdsOfNetworkInterfaces; gr.insert();
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2013 07:24 AM
It was a problem with my unit test. I was executing this in the background scripts window and at the end of my unit test when I was confirming the results by requerying the table I had failed to call "next()". The comma delimited list works great.
Thanks!