Renaming primary key

Hey,

i have a separate table which contains list of items. I also subscribed to a onAfterRename event on item table. So when a item number is renamed, the item on the list should also be renamed. I cannot get it to work with RENAME function: 

 

 Itemlist.SETFILTER("Item No.",xRec."No.");

 IF Itemlist.FINDSET THEN BEGIN
   REPEAT
     Itemlist.RENAME(Itemlist."Item No.",Rec."No.");

    UNTIL Itemlist.NEXT = 0;
  END;

Rec is the item record. 

 

does anybody know what's the problem in above code?

 

Parents
No Data
Reply Children
No Data
Related
Recommended