Get Table Data

jjmmss1jjmmss1 Member Posts: 32
I have 2 tables Table1 and Table2.

Table1 has 2 fields "Barcode No1" and "Qty1".

Table1 is populated with values.

Table2 has 2 fields "Barcode No.2" and "Qty2".


Field "Barcode No.2" is populated with values. few "Barcode No2" is same as Table1's "Barcode No1"

I want that
when "Barcode No.2" :="Barcode No1" THEN

"Qty1".:="Qty2".;

How can I do this (Using Codeunit)?

Comments

  • DenSterDenSter Member Posts: 8,307
    You try to get a record from table2 with the barcode1 value, and if it finds one then you set its quantity to the right value, just like you explained :).
    IF Table2.GET(Barcode1) THEN BEGIN
      Table2.Quantity := Table1.Quantity;
      Table2.MODIFY;
    END;
    
Sign In or Register to comment.