foundset.getRelationName() is null

Questions and answers for designing and implementing forms in Servoy

foundset.getRelationName() is null

Postby maria.kyselova » Tue Feb 12, 2013 7:31 am

Hi Guys,

I execute some code in one of my forms and the form is in one of my tabs.
The workflow is so that I may or may not click on the tab before I run my code.
The problem I am having happens when I run the code before clicking on the tab (before loading/showing that form) and the problem is that foundset.getRelationName() returns null.

I tried to trigger the form loading in code before running the function but it doesn't seem to affect things.

Any ideas on why it happens and whose fau.. err.. what to do? :P
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: foundset.getRelationName() is null

Postby mboegem » Wed Feb 13, 2013 3:55 pm

maria.kyselova wrote:Any ideas on why it happens and whose fau.. err.. what to do?

The problem is always between the keyboard and the chair :wink:

Anyway... when you run the code on your form before it is shown on the tab, the relation you specified on that particular tab isn't applied yet to the foundset.
That's why it's returning null.

There's no way you're gonna change that, except showing the form on the tabpanel first.

The real question is: why do you need that relation so badly on the form itself?
Code should run fine from any context your form is in, otherwise I'd think about different architecture...
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests

cron