I am currently working on a grid that requires custom controls to call an xbasic function to populate detail information.
I know that is a rather dense description, but here's where it breaks down:
I have to make multiple calls for each row in the grid. I don't want to have to re-create an SQL connection object for every step.
If I could just tie in to a global connection object, that would be great. For instance in the onSqlSelectQuery server side event there is the element "e.cn". If this element is available for the custom xbasic functions section, I have not figured out how to use it.
Or if the connection still exists during page render and I could re-define the scope to include the existing connection for the xbasic functions, that would be great.
I have tried to get that working without success. My last ditch effort is to create an sql connection wrapper function to be called by the other custom functions. In it I would check to see if the connection existed, create it if it does not, and then return the connection object.
In the end, this is all about variable scope. I've looked around in the documentation and the forums for any useful information, and haven't found anything. Most of the documentation relating to global variables was about the desktop version of the software, which is of no use to me. If you can at least point me in the right direction on this, I'd be very thankful. Maybe the only solution is to re-create a new sql connection object every time one of the functions is called, but that just seems terribly inefficient to me.
I know that is a rather dense description, but here's where it breaks down:
I have to make multiple calls for each row in the grid. I don't want to have to re-create an SQL connection object for every step.
If I could just tie in to a global connection object, that would be great. For instance in the onSqlSelectQuery server side event there is the element "e.cn". If this element is available for the custom xbasic functions section, I have not figured out how to use it.
Or if the connection still exists during page render and I could re-define the scope to include the existing connection for the xbasic functions, that would be great.
I have tried to get that working without success. My last ditch effort is to create an sql connection wrapper function to be called by the other custom functions. In it I would check to see if the connection existed, create it if it does not, and then return the connection object.
In the end, this is all about variable scope. I've looked around in the documentation and the forums for any useful information, and haven't found anything. Most of the documentation relating to global variables was about the desktop version of the software, which is of no use to me. If you can at least point me in the right direction on this, I'd be very thankful. Maybe the only solution is to re-create a new sql connection object every time one of the functions is called, but that just seems terribly inefficient to me.
Comment