Data Sources Join

rponslerrponsler Member Posts: 8
edited 2010-08-17 in Dynamics AX
I can see where to join two data sources on a form. And I can see the join type. I am missing where you specify the column in each of the tables to make the join. So by entering the source table and the join type HOW does AX know which columns from the two tables it should use to make the join?

Comments

  • pedroparrapedroparra Member Posts: 58
    Hi Again!

    You have to use the addLink method at the second dataSource to add the relation. Here a brief example: (Please look up at the last code line)

    query = new Query();
    // Add the first data source to the query
    queryBuildDataSource1 = query.addDataSource(tablenum(SalesTable));
    // Add the range to this first data source
    queryBuildRange = queryBuildDataSource1.addRange(fieldnum(SalesTable, deliveryDate));
    //Secound data Source
    queryBuildDataSource2 = queryBuildDataSource1.addDataSource(tablenum(SalesLine));
    // Add the link from the child data source to the parent datasource
    queryBuildLink = queryBuildDataSource2.addLink(fieldnum(SalesTable,SalesId),fieldnum(SalesLine, SalesId));
  • rponslerrponsler Member Posts: 8
    wow! thanks for all the help. This stuff is seriously different than what I am used to - which is JD Edwards :-)
  • pedroparrapedroparra Member Posts: 58
    Welcome to the Dynamics Ax world. You would be surprised how easy you can customize your ERP!
Sign In or Register to comment.