// JWJ0215 4.2.24 // get all the tables in the cmdb class ClearUserLog(); var table = new GlideRecord("sys_db_object"); table.addQuery("name", "STARTSWITH", "cmdb_"); table.query(); UserLog(table.name); while(table.next()){ //Create a glide record for creating new list entry's var list_entry = new GlideRecord("sys_ui_related_list_entry"); UserLog(list_entry.number); // GlideRecord to find the list var list = new GlideRecord("sys_ui_related_list"); // Find the list list.addQuery("name", table.name); list.query(); // if there is a list add a new entry if(list.next()){ // Create the list entry list_entry.initialize(); list_entry.related_list = "kb_knowledge.cmdb_ci"; list_entry.list_id = list.sys_id; list_entry.position = 100; list_entry.insert(); UserLog(list_entry.related_list + list_entry.list_id); } }