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.
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;
Comments
target.modify;
RIS Plus, LLC
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;
http://midynav.blogspot.com/ (Microsoft Dynamics Navision)