.convertFoundSet() problem

Hi All,

A small but frustrating thingy: databaseManager.convertFoundSet(fs1, fs1.relatedFS); returns null while fs1.relatedFS returns one valid record (as expected).

What can be the problem?

The relation ‘relatedFS’ has two conditions, one joins two tables on their keys as usual and the other goes from a UUID column in the destination table to a global variable.
I played with the type of the global variable thinking that it might be causing issues.
Still, it works fine if I just want to get a related foundset, but doesn’t - for .convertFoundSet();

Cheers,
Maria

Update:

fs1 is defined earlier in the code as fs1 = fs.relatedRecords;

Still a valid foundset, I suppose…

Also, if I use a different relation instead of relatedFS and that relation is not using a global variable, then things work just fine!

Hi Maria,

maria.kyselova:
databaseManager.convertFoundSet(fs1, fs1.relatedFS)

I think it’s your syntax.

Let’s say your relationname is ‘tableA_to_tableB’ then your code should look like:

databaseManager.convertFoundSet(fs1, tableA_to_tableB)

Servoy needs the relation object that works for fs1, as it will combine all related records of each record in fs1 into a new foundset: Great function!

Hope this helps

mboegem:
Hi Maria,

maria.kyselova:
databaseManager.convertFoundSet(fs1, fs1.relatedFS)

I think it’s your syntax.

Let’s say your relationname is ‘tableA_to_tableB’ then your code should look like:

databaseManager.convertFoundSet(fs1, tableA_to_tableB)

Servoy needs the relation object that works for fs1, as it will combine all related records of each record in fs1 into a new foundset: Great function!

Hope this helps

Hi Marc,

Nah :) I’ve tried all sorts of syntax.
What you suggested didn’t work, I also tried quotes around the relation name, all sorts of things epically failed.

The function is great, I agree and I love it and use it everywhere.

Um. Just ran it now before posting the reply and it works. With the old syntax, like in my first message.
Whatever happened… Sorry about the wasting your time, Marc.

Cheers,
Maria