Problems running JSL calling Microsoft SQL from Add-in
Jan 16, 2015 7:42 AM(1069 views)
Has anyone else ever encountered problems running JSL code from within an Add-In? I have encounter right now the following issue: I have a working JSL code that should be downloading data from a database, i.e. is connecting to Microsoft SQL server and sending an SQL query to it. When I run it from the Script window it works fine, when I put it into the add-in, re-install the add-in and try to run, the SQL server says "Error near ',' ". Any ideas?
Re: Problems running JSL calling Microsoft SQL from Add-in
Jan 16, 2015 6:26 PM(915 views)
In my experience, issues like this usually come down to namespaces. In the script editor, if you haven't explicitly called NamesDefaultToHere(), you will be defaulting to the global namespace. By default, scripts from an add-in run in the Here namespace. There may just be a variable in your addin that needs a scope modifier in front ("::" I think). Or, in the Menu Editor, I believe there is a check box you can set for an item to determine if its script runs in the Here namespace or not. That's where I would start looking.