Hello,
I have 2 tables
Table 1 - Header
Table 2 - Line
i have written code on onrename() as
IF "Whse. Receipt No."<>xRec."Whse. Receipt No." THEN
BEGIN
"Cart Line".SETRANGE("Whse. Receipt No.",xRec."Whse. Receipt No.");
"Cart Line".SETRANGE("Carton No.","Carton No.");
IF "Cart Line".FINDSET() THEN BEGIN
REPEAT
"Cart Line".RENAME("Whse. Receipt No.","Cart Line"."Carton No.","Cart Line"."Carton Line No.");
UNTIL "Cart Line".NEXT=0;
END;
END;
if i rename "Whse. Receipt No." in header table the same have to be updated in Line Table.
but my code is updating only first record in line Table
all the other records remain same.
kindly help me how the entire records renamed.
Thanks in advance
0
Comments
Maybe someone other have better solution, but this work for sure.
This error is about Key in loop. Using another record variable for rename will dont change sort of original loop.