Why is field not found when running script from within a scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017 10:32 AM
I run the script below from the Background Scripts module with the scope set to "global" and I have no issues. However, if I switch the scope to another scoped application, I get the error "field name 'product.u_development_offering' not found in table 'rm_story'".
Why is this and how can I run a script from within a scope and access this u_development_offering field?
A few of other notes:
- The u_development_offering field is a custom field added to the cmdb_application_product_model table
- I do not get this error when changing "u_development_offering" to be an out-of-the-box field on that same table, like "name" or "short_description"
- I cannot see any system log messages and this script did not generate a cross-scope access record (so assuming cross-scope access is not an issue)
var gr = new GlideRecord("rm_story");
gr.addQuery("state", "2");
gr.addQuery("product.u_development_offering", "Self Service");
gr.query();
while (gr.next()) {
gs.info("story: " + gr.number + ": " + gr.product.name);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017 10:36 AM
Hi,
This is expected since you added column in global scope.
cmdb_application_product_model table is part of GLOBAL scope.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017 10:45 AM
Yes, but I can access the out-of-the-box columns just fine, and they are in global too. This issue seems limited to custom columns created on this table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017 10:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017 10:44 AM
The table I'm querying is in global, and I'm able to query out-of-the-box fields on it just fine. It seems that it's just the custom fields that are an issue. Also, the scope I'm running it from does not enforce cross-scope access, so I don't think I'd need to create cross-scope access records.