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.