The CreatorCon Call for Content is officially open! Get started here.

Why is field not found when running script from within a scope?

lss123
Tera Contributor

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

}

6 REPLIES 6

Community Alums
Not applicable

Huh. That's really strange, then.


MaxS16945435101
Tera Contributor

Did you ever find a solution to this problem? I'm facing the same issue...