Beginner (how to access data from other table)

Hello,

i am a beginner developer in x++ and this is my first post at this forum.

i have a form, that has 2 tables. i want to get the value of one field of the table “PurchTable2” from the initValue method of the table “PurchLine2”. But i don’t know how to acces to the data of the table PurchTable2. I can see the form with data in it.

is this posible?

Any help?

my code:

public void initValue()

{

;

if (!this.lineNum)

this.lineNum = PurchLine2::lastLineNum(PurchTable2.PurchId2) + 1.0;

super();

}

I apologize for my mistakes in English, i’m Basque, and you konw how bad we are in foreign languages…

you can relate both the table using “PurchId” field , with tis relation you can get the req data in either table

thnks for yor reply…but i just have the relation with PurchId.

my problem is how to req the date of PurchTable2 from the initValue of PurchLIne2. From Table method.

The tables are relationed by the Data Source Propertys JoinSource and LinkType Delayed.

if i make a query, i can see the data at both tables in the form.

My code is at the table, not at the dataSource of the Form.

thanks in advance