Invalid Field/Related field combination with dynalink

Hi,

I have to link SMAServiceOrderTable together. One service order can be linked to severals.

So I have created this table with those relations

Now in the Form I want to add the table twice to show all the links where the current serviceOrder is the source and in another grid show all the links where the current serviceOrder is the target.

Because we cannot add referenced datasource in a table extension (-_-) and because we cannot chose a relation when adding the datasource with a join source (never understand why since it is possible for references datasources…). I must overrides the init method to clear and add the dynalinks I want.

pastedimage1613262906612v4.png

When launching my form I got the famous “Invalid Field/Related field combination” and I can’t understand why…

I’ve printed the tableId of the element.NEX_SMAServiceOrderTableLinkedTo to be sure it is well existing.

What am I missing ?

Regards,

Your code is indeed wrong. The first argument of dynalink() should be a field of NEX_SMAServiceOrderTableLink. The second argument should be a buffer of the parent table, i.e. SMAServiceOrderTable. And the third one should be a field from SMAServiceOrderTable.

Indeed -_-

I’ve been bamboozled by the addLink which is inverted. Thanks for pointing this out :slight_smile: (And it makes more sense to add the parent dataSource rather than the current DS :D)