forms.form.relation.foundset

Questions, tips and tricks and techniques for scripting in Servoy

forms.form.relation.foundset

Postby Hans Nieuwenhuis » Wed Jun 03, 2009 8:54 pm

Hi,

in 3.5.9 we sometimes use the following syntax when creating new related records :

Code: Select all
forms[_form].bvko_verkorderregels_to_inkorderspecregels.foundset.newRecord()


This works fine when used on an existing record in the [_form] an also when used on a new record in [_form]

In 4.1.3 it works fine when used on an existing record in the [_form] , but it fails when used on a new record in [_form]

The error is :
MSG: TypeError: Cannot call method "newRecord" of undefined


When is change the code to :
Code: Select all
forms[_form].bvko_verkorderregels_to_inkorderspecregels.newRecord()


it works fine in 4.1.3 in both cases.

I suppose in 3.5.9 it makes no difference wether you use relation.foundset.newRecord or relation.newRecord,
but I wunder why this behaviour has changed in 4.1.x ??

Regards,

Hans
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: forms.form.relation.foundset

Postby jcompagner » Wed Jun 03, 2009 9:03 pm

that relation.foundset.xxx works in 3.5.x is more by accident and could be considered a bug instead of a feature.

relation is a foundset. So doing .foundset on them doesnt make any sense.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: forms.form.relation.foundset

Postby Hans Nieuwenhuis » Wed Jun 03, 2009 9:16 pm

Thanks Johan,

That's what I suspected.
We will change that code.

Regards,

Hans
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 39 guests

cron