21. Januar 2009 17:02
IF Rec.Code <> xRec.Code THEN
RelatedItems.SETRANGE("Table ID",50001);
RelatedItems.SETRANGE("No.",xRec.Code);
IF RelatedItems.FIND('-') THEN
REPEAT
RelatedItems.RENAME(50001,RelatedItems.Type,Rec.Code,RelatedItems."Line No.");
UNTIL RelatedItems.NEXT = 0;
21. Januar 2009 17:05
21. Januar 2009 17:10
21. Januar 2009 17:36
Malhody hat geschrieben:meinst du allgemein sollte rename durch delete + insert ersetzt werden??
21. Januar 2009 17:44
IF RelatedItems.FIND('-') THEN
REPEAT
RelatedItems.RENAME(50001,RelatedItems.Type,Rec.Code,RelatedItems."Line No.");
UNTIL RelatedItems.NEXT = 0;
IF RelatedItems.FIND('-') THEN
REPEAT
RelatedItems2 := RelatedItems;
RelatedItems2.RENAME(50001,RelatedItems2.Type,Rec.Code,RelatedItems2."Line No.");
UNTIL RelatedItems.NEXT = 0;
21. Januar 2009 20:01
IF Rec.Code <> xRec.Code THEN BEGIN
RelatedItems.SETRANGE("Table ID",50001);
RelatedItems.SETRANGE("No.",xRec.Code);
IF NOT RelatedItems.ISEMPTY THEN BEGIN
RelatedItems.FINDSET;
REPEAT
TempRelatedItems := RelatedItems;
TempRelatedItems.INSERT;
UNTIL RelatedItems.NEXT = 0;
TempRelatedItems.FINDSET;
REPEAT
RelatedItems.GET(50001, TempRelatedItems.Type,xRec.Code,TempRelatedItems."Line No.");
RelatedItems.RENAME(50001,TempRelatedItems.Type,Rec.Code,TempRelatedItems."Line No.");
UNTIL TempRelatedItems.NEXT = 0;
END;
END;
21. Januar 2009 20:08
IF NOT RelatedItems.ISEMPTY THEN BEGIN
RelatedItems.FINDSET;
21. Januar 2009 21:12
27. Februar 2009 16:33
Ersetze RENAMEs wo es nur geht durch DELETE + INSERT.
Dein Beispiel ist tödlich, selbst Natalies Beispiel halte ich für gewagt
Wie siehts mit sowas aus? Alternativ auch per DELETE/INSERT.