Hi Cenk Ince,
Set the "JoinSource" property of Table2 to "Table1"
(Table2 will follow Table1).
Then, if you want to show them in the same grid, then
change "LinkType" property of Table2 to "InnerJoin"
(just like SalesLine and InventDim).
If you want to show them in different grid, then
nothing is changed (just link SalesTable and
SalesLine).
Next, override init method of Table2 and put this code
after super():
//if joinType is innerJoin
this.query().dataSourceTable(tableNum(Table2)).addLink(
fieldNum(Table1,field1),
fieldNum(Table2,field1));
//if joinType is delayed
//this.query().dataSourceTable(tableNum(Table2)).addDynalink(
// fieldNum(Table2,field1),
// Table1,
// fieldNum(Table1,field1));
I tried above code using new Tables (Table1 and
Table2) with no relation between tables, no EDT and it
worked well.
Good luck.
Regards,
Sonny Wibawa Adi
--- Cenk Ince <[EMAIL PROTECTED]> wrote:
> Hi all;
>
> I have 2 data sources on a form. Table1, Table2.
>
> There is no relation on Table2 for Table1. I want to
> put them on a form and join them on a field.
>
> I want to show data from both tables on a grid, but
> i don't want to use display methods.
>
> What i want to do is like salesline and inventDim.
> Just want to set relation with code.
>
> How to do it?. Thanks.
>
>
>
> Cenk Ince
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
>
__________________________________
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

