.convertFoundSet() problem

Questions, tips and tricks and techniques for scripting in Servoy

.convertFoundSet() problem

Postby maria.kyselova » Thu Nov 08, 2012 3:21 am

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
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: .convertFoundSet() problem

Postby maria.kyselova » Thu Nov 08, 2012 3:22 am

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!
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: .convertFoundSet() problem

Postby mboegem » Thu Nov 08, 2012 11:14 am

Hi Maria,

maria.kyselova wrote: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:
Code: Select all
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
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: .convertFoundSet() problem

Postby maria.kyselova » Fri Nov 09, 2012 1:07 am

mboegem wrote:Hi Maria,

maria.kyselova wrote: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:
Code: Select all
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
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am


Return to Methods

Who is online

Users browsing this forum: No registered users and 12 guests