Insertion of same fields from one table to the other

FreakyFreaky Member Posts: 125
Hi Guys, I have two tables Table1 and Table2. Table1 has primary keys -Line No.,Employee No. and Table2 has primary key - line no only. Please how can I transfer fields from Table2 to Table1 on a report by coding.


Please assist
Thanks in advance.

Comments

  • DenSterDenSter Member Posts: 8,305
    target.field := source.field;
    target.modify;
  • veerendraveerendra Member Posts: 66
    This example shows how to use the FINDSET function to loop through a set and update a field that is within the current key.

    Copy Code
    SalesShptLine.SETRANGE("Order No.",SalesLine."Document No.");
    SalesShptLine.SETRANGE("Order Line No.",SalesLine."Line No.");
    SalesShptLine.SETCURRENTKEY("Order No.","Order Line No.");
    IF SalesShptLine.FINDSET(TRUE, TRUE) THEN BEGIN
    REPEAT
    SalesShptLine."Order Line No." := SalesShptLine."Order Line No." + 10000;
    SalesShptLine.MODIFY;
    UNTIL SalesShptLine.NEXT = 0;
    END;
    Veerendra Ch.
    http://midynav.blogspot.com/ (Microsoft Dynamics Navision)
Sign In or Register to comment.