runScript Issue

I’m able to use and expression that utilizes runScript within a label expression but it is not working withing a SQL tag expression.

The script returns a simple integer value from an app.script. I have verified that the data types match and no errors are being generated within the app.script.

Any thoughts?

App scripts are project scoped, where as SQLTags are gateway scoped. The scripts create as app scripts are unavailable to the gateway, therefore you can not use an app script to update a DB SQLTag. I believe you can use an app script to update a Client SQLTag though.

On a side note, it would be nice to create gateway scoped scripts, and scripts available to both the project and the gateway. Maybe for 7.3?

Yeah, some sort of true global script library that spans all projects in a Gateway seems like it would be in order. Maybe under a new namespace? For example, [tt]system.[/tt], [tt]app.[/tt], and a new one called [tt]lib.*[/tt]? (The word “global” is a reserved keyword in Python, so we can’t use that)

The tricky thing about gateway-scoped resources is that they conflict conceptually with most other things in the Designer. For example, the new publishing system, which is project based by definition, wouldn’t work for these scripts.

Moving this to feature requests…

Could you use the namespace “gateway”?

Thanks guys for a quick response. I agree this would be a great feature. In the meantime you may want to update the help file to communicate the runscript limitations withing a SQL tag.

I ended up must having the app.script update the SQL tag.

Thanks again guys.

“gateway” wouldn’t really be appropriate. After all, we do already have gateway-scoped scripts. Sure, they’re part of a project, but projects run on the Gateway too. And I think that these scripts should be available in all scopes.