Joining Tables

Hi. I have 2 tables, Table A(Source) and Table B( Target). I added a field in table B named External No. This field already exists in Table A, so i now want this field in Table B to populate data from the same field in A.

I have tried to link this table using the the table relation option, but unfortunately, these two tables dont share the same primary key. I tried inserting code in target table to try and update the data with no success.

So in table B, field “External No.”, what do you have in TableRelation property? When you tried to link the two tables, what did you actually do?

Table 1(Source).

Table 2(Target).

In the the target table, i added a field called ‘External Document No.’.

This field already exists in Table A.

In Table 2 designer, i went to the added field-‘External Document No.’,

→ Properties,-> Table Relation.

In the Table relation, under the Table Field, i put in Table 1.

In the Field,field, i put in ‘External Document No.’.

When i run the table, i however get an error saying,"‘External Document No.’ is not part of Table 1 Primary key.

‘External Document No.’ is not a primary key in both tables.

Hi Douglas Munyoro,

What type of relation (Normal, …) had you used to join the two tables ?

You only want to populate external document of Table A in Table B, if yes then just make Table B field as flow field and lookup the value in Table A.

If that’s the case, then you’d probably want to define External Document No. in table 2 as a flowfield - a lookup into table 1, with table filter properties that uniquely identify the source record in table 1. To do that, you’ll want to create additional fields in table 2 that replicate the primary key in table 1. For an example, take a look at the definition of the “G/L Account Name” field in t_17 G/L Entry.