get another table's value to show it in subform

hi

for example i have two tables like this:

table1: productid productname

table2: id productid username

i am new in navision. suppose that i have a form and init a subform. this subform gets its values from table 2 but i want to show table2’s productid as productname. How can i get productname value to that field in the subform. Or is there any other good solutions to do that?

Hi,

Not sure what you want exactly but if you create one form (based on table 2) and a record variable for table 1. then in the onaftergetcurrrecord trigger use

if table1.get(table2.productid ) then // if is to stop error if record does not exist

table1.init;

then add a textbox with source expression on table1.productname.