how to join two tables and display it in a tabular form

mkpjsrmkpjsr Member Posts: 587
how to display the fields from two tables in a tabular form.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    The second table you need to handle manually.

    In the "OnAfterGetRecord"-trigger, you must put code to get the second record. And in the tabular form, you need to add columns manually with the fields you need from the second table.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • lvanvugtlvanvugt Member Posts: 774
    Or running NAV on SQL Server you could use How-to: Use SQL Views in NAV.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • krikikriki Member, Moderator Posts: 9,110
    And especially see http://dynamicsuser.net/blogs/waldo/archive/2008/11/08/how-to-display-an-sql-server-view-in-microsoft-dynamics-nav.aspx
    One thing I do want to give as a remark is that if you're taking a backup with the Microsoft Dynamics NAV Client and you try to restore, you'll be missing the view and the restore fails. Therefore, I would like to give you this tip: always create a script of the created view in the Management Studio and save it somewhere safe. You can create a script by right clicking on the view, then "Script View as" / "Create To" / "File..." . See below.

    That is the main reason I do not really like a SQL server view used as a table in NAV.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • davmac1davmac1 Member Posts: 1,283
    If your purpose is to display only without editing and there are not too many fields in the second table, you could use flowfields.

    BTW - I have used the view approach and it works beautifully except for the workarounds as mentioned on backup and restore using Navision. SQL backups and restores don't have that problem, but they only work for the entire database.
Sign In or Register to comment.