forms.form.relation.foundset

Hi,

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

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 : ```
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

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.

Thanks Johan,

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

Regards,

Hans