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;
0
Comments
what's "codOld" doing?
anyway...
So you need to delete the "TY" from your #.
Something like this.
codNo := DELCHR("No.",'=','TY');
http://www.BiloBeauty.com
http://www.autismspeaks.org
By the way it was all the code. Codno is set up at data type "Code" in variables.
http://www.BiloBeauty.com
http://www.autismspeaks.org