Renaming a primary key with a report

Shaz73Shaz73 Member Posts: 16
We have a report in our system that was created by our developer to rename the item numbers in item table for a certain category.
I have the following codes where a no was changed from having TY##### to STY#####. Now I need to remove the TY and only leave S so the number should be S#####. Can someone help me to modify this code please.


blnSkip := TRUE;
dia.UPDATE(1, "No.");
IF (STRPOS("No.", 'TY') = 1) AND ("Item Category Code" = '1100') THEN BEGIN
codOld := "No.";
codNo := 'S' + "No." ;
IF NOT lrecItem.GET(codNo) THEN BEGIN
RENAME(codNo);
IF i > 50 THEN BEGIN
COMMIT;
i := 1;
END;
i := i + 1;
blnSkip := TRUE;
END ELSE BEGIN
blnSkip := FALSE;
END;
END;

Comments

Sign In or Register to comment.