The Rookie Rides Again - Referencing table elements

Hi all,

Ok, so I know that you can reference elements in a table attached to a form programatically by using the “forms.” method of referencing. But, what if the information I need is in an element in a table not attached to the form I’m currently in? I’m not sure what the mechanism would be for obtaining that information.

Any hints? Even better, a reference in the doc that explains it?

As always, thanks for your assistance.

Ron

I’m not sure if I understand you correctly, but do you want to access data from a table without using a form?

For that you can use the function databaseManager.getFoundSet(), to get a foundset on any table, for example:

var _fs = databaseManager.getFoundSet("servername", "tablename");

//Now we have a foundset and we can do anything we want on it
_fs.loadRecords(....);
_fs.columname = ....;

Hi Ron,

You can use foundsets to access any table object, even from tables that are not used by any forms.
Take a look at the function databaseManager.getFoundSet().

Hope this helps.

Hi Joas and Robert,

You both seem to have hit it right on. Thanks so much for you suggestions. Looks like exactly what I need.

Ron

As it turns out, there is a nice explanation of using Foundsets in this way in Adrian McGilly’s Servoy Beginner’s Handbook. It’s available from his website at http://www.mcgilly.com. I think it’s well worth the money, but then, I am a Rookie. :D