Can't find records being returned in a script related to sc_cat_item

Oliver Anderson
Kilo Sage

I need to change the access_type of many of our catalog items to 'delegated' as part of a recent effort to clean up and standardize our catalog items. I created a script to find all of the records on sc_cat_item that have an access_type of 'restricted' and found a lot of records that I didn't recognize. 

var gr = new GlideRecord('sc_cat_item');
gr.addActiveQuery();
gr.addQuery('access_type', 'restricted');
gr.query();
while (gr.next()) {
	gs.print(gr.name.getDisplayValue());
	for (var prop in gr) {
		gs.info("    " + prop + "    :    " + gr[prop]);
	}
	gs.print("\n\n");
}

 

There are many records returned from this script that have a sys_update_name beginning with 'sc_cat_item_content.' Here are a few examples:

Roles
    sys_meta    :    sys_meta
    sys_replace_on_upgrade    :    false
    entitlement_script    :    
    use_sc_layout    :    true
    show_variable_help_on_load    :    false
    no_order_now    :    false
    sc_ic_version    :    0
    delivery_time    :    1970-01-03 00:00:00
    sys_updated_on    :    2014-01-13 17:44:02
    type    :    item
    published_ref    :    
    no_search    :    false
    sys_updated_by    :    jared.laethem
    price    :    0
    sys_created_on    :    2013-09-20 21:06:12
    recurring_frequency    :    
    sys_name    :    Roles
    model    :    
    state    :    
    no_cart    :    false
    sys_created_by    :    maint
    group    :    
    order    :    2
    hide_sp    :    false
    start_closed    :    false
    image    :    
    no_quantity    :    false
    workflow    :    
    delivery_plan    :    523da512c611228900811a37c97c2014
    active    :    true
    no_proceed_checkout    :    false
    custom_cart    :    
    no_cart_v2    :    false
    checked_out    :    
    version    :    0
    ignore_price    :    false
    sys_update_name    :    sc_cat_item_content_01d39af3eb330100d4360c505206feee
    meta    :    
    omit_price    :    false
    name    :    Roles
    flow_designer_flow    :    
    mobile_hide_price    :    false
    no_wishlist_v2    :    false
    sys_policy    :    
    template    :    
    preview    :    Javascript: popupOpenStandard("com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=01d39af3eb330100d4360c505206feee&sysparm_preview=true", "summary");
    short_description    :    
    access_type    :    restricted
    fulfillment_automation_level    :    unspecified
    roles    :    admin
    icon    :    
    description    :    
    mobile_picture    :    
    sc_template    :    
    availability    :    on_desktop
    mandatory_attachment    :    false
    request_method    :    
    visible_standalone    :    true
    visible_guide    :    true
    sys_class_name    :    sc_cat_item_content
    sys_id    :    01d39af3eb330100d4360c505206feee
    no_order    :    false
    template_manager_roles    :    
    vendor    :    
    no_attachment_v2    :    false
    mobile_picture_type    :    use_desktop_picture
    visible_bundle    :    true
    sys_scope    :    global
    sc_catalogs    :    0b22fd2ad7021100b9a5c7400e610319
    make_item_non_conversational    :    false
    ordered_item_link    :    
    owner    :    
    no_delivery_time_v2    :    false
    cost    :    0
    no_quantity_v2    :    false
    sys_mod_count    :    6
    recurring_price    :    0
    sc_ic_item_staging    :    
    list_price    :    0
    sys_tags    :    
    billable    :    false
    picture    :    
    sys_package    :    d00524a4db2022003fb879531f9619be
    display_price_property    :    non_zero
    taxonomy_topic    :    
    delivery_plan_script    :    
    location    :    
    category    :    e5354ab3eb330100d4360c505206fed5
    no_save_as_draft    :    false
    sys_customer_update    :    false



Define indicators
    sys_meta    :    sys_meta
    sys_replace_on_upgrade    :    false
    entitlement_script    :    
    use_sc_layout    :    true
    show_variable_help_on_load    :    false
    no_order_now    :    false
    sc_ic_version    :    0
    delivery_time    :    1970-01-03 00:00:00
    sys_updated_on    :    2014-03-28 13:33:22
    type    :    item
    published_ref    :    
    no_search    :    false
    sys_updated_by    :    admin
    price    :    0
    sys_created_on    :    2014-03-28 12:16:36
    recurring_frequency    :    
    sys_name    :    Define indicators
    model    :    
    state    :    
    no_cart    :    false
    sys_created_by    :    admin
    group    :    
    order    :    0
    hide_sp    :    false
    start_closed    :    false
    image    :    
    no_quantity    :    false
    workflow    :    
    delivery_plan    :    523da512c611228900811a37c97c2014
    active    :    true
    no_proceed_checkout    :    false
    custom_cart    :    
    no_cart_v2    :    false
    checked_out    :    
    version    :    0
    ignore_price    :    false
    sys_update_name    :    sc_cat_item_content_034fad20d733110048e04ebfae6103e4
    meta    :    
    omit_price    :    false
    name    :    Define indicators
    flow_designer_flow    :    
    mobile_hide_price    :    false
    no_wishlist_v2    :    false
    sys_policy    :    
    template    :    
    preview    :    Javascript: popupOpenStandard("com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=034fad20d733110048e04ebfae6103e4&sysparm_preview=true", "summary");
    short_description    :    Create new automated indicators
    access_type    :    restricted
    fulfillment_automation_level    :    unspecified
    roles    :    
    icon    :    
    description    :    
    mobile_picture    :    
    sc_template    :    
    availability    :    on_desktop
    mandatory_attachment    :    false
    request_method    :    
    visible_standalone    :    true
    visible_guide    :    true
    sys_class_name    :    sc_cat_item_content
    sys_id    :    034fad20d733110048e04ebfae6103e4
    no_order    :    false
    template_manager_roles    :    
    vendor    :    
    no_attachment_v2    :    false
    mobile_picture_type    :    use_desktop_picture
    visible_bundle    :    true
    sys_scope    :    global
    sc_catalogs    :    0b22fd2ad7021100b9a5c7400e610319
    make_item_non_conversational    :    false
    ordered_item_link    :    
    owner    :    
    no_delivery_time_v2    :    false
    cost    :    0
    no_quantity_v2    :    false
    sys_mod_count    :    1
    recurring_price    :    0
    sc_ic_item_staging    :    
    list_price    :    0
    sys_tags    :    
    billable    :    false
    picture    :    
    sys_package    :    0ce6e4a8db2022003fb879531f961958
    display_price_property    :    non_zero
    taxonomy_topic    :    
    delivery_plan_script    :    
    location    :    
    category    :    7a0fad20d733110048e04ebfae610331
    no_save_as_draft    :    false
    sys_customer_update    :    false

 

When I try to find these records on the list view of sc_cat_item_content - they're not there. When I manually search for the individual sys_ids by plugging the sys_id into SN Utils, I get a "Record not found" error.

OliverAnderson_0-1732722052652.png

 

I'm confused as to what these records are and where these records live. They're getting pulled from a query on sc_cat_item, but then according to their properties, they're not actually on the sc_cat_item table, and when searching throughout the entire instance for them by sys_id, it seems like they don't exist at all.

 

Can anyone provide insights into what these are?

2 REPLIES 2

JenniferRah
Mega Sage

When I run your script, I see the same records I see when I do a view with that restriction. Are you running the script as an admin and viewing it as something less than an admin? Perhaps they are just hidden from you? Other than that, I have no ideas as to why the script would see them and you wouldn't.

I have full system admin roles, so no - I should be able to see everything. I even elevated to security_admin and was still unable to see them outside the script output.