Page 1 of 1

Searching through an unrelated foundset?

PostPosted: Fri Oct 11, 2013 6:22 am
by johann.agcanas
Hi,

I'm trying to create a record in a table while attempting to validate it through another table's record. I'm not sure if I'm doing it correctly.
The scenario is this. I have two tables, A and B. I need a new record in A, but need to check if a record in B exists for the foreign key that I input. How is this done in Servoy Mobile? Normally I would just create another foundset and do a find, but for some reason I cannot access any other foundsets in mobile.

What I'm currently attempting to do is create another foundset and search through it, but it's not working:
Code: Select all
var customers = databaseManager.getFoundSet('db:/server/b_table');

Chrome debug shows some object that has an array of stuff but it's very different from the object I get from var customers = foundset;. Also, creating a foundset from the form's datasource always has a 0 size, despite the foundset object (which contains the form's datasource's records) contains the correct records.

Re: Searching through an unrelated foundset?

PostPosted: Mon Oct 14, 2013 7:02 pm
by swingman
Sorry, I realise that I did not read you question properly....

Re: Searching through an unrelated foundset?

PostPosted: Wed Nov 27, 2013 5:36 pm
by jcompagner
var customers = databaseManager.getFoundSet('db:/server/b_table');
customers.loadAllRecords()

that should load all the customers, i think by default it is empty