21. Juli 2009 10:49
File.RESET;
File.SETRANGE(Path,'');
IF File.ISEMPTY THEN;
File.SETRANGE(Path,PurchaseOrderImportPath);
File.SETRANGE("Is a file",TRUE);
File.SETFILTER(Name,'*.xml');
IF File.FIND('-') THEN BEGIN
REPEAT
IF FileNotInUse(PurchaseOrderImportPath+File.Name) THEN BEGIN //Prüfen ob Datei in Benutzung
InFile.OPEN(PurchaseOrderImportPath+File.Name);
InFile.CREATEINSTREAM(InStream);
XMLPORT.IMPORT(50001,InStream);
InFile.CLOSE;
RenameAndCopyFiletoArchive(PurchaseOrderImportPath+File.Name); //Datei umbenennen und ins Archiv kopieren
COMMIT; //
END;
UNTIL File.NEXT = 0;
END;
21. Juli 2009 11:54
InFile.OPEN(PurchaseOrderImportPath+File.Name);
InFile.CREATEINSTREAM(InStream);
XMLPORT.IMPORT(50001,InStream);
InFile.CLOSE;
REPEAT
...
DeineCodeunit.SetzeEvtlParameter;
IF DeineCodeunit.RUN THEN BEGIN
RenameAndCopyFiletoArchive(PurchaseOrderImportPath+File.Name);
END ELSE BEGIN
RenameAndCopyFiletoErrorFolder;
END;
...
UNTIL
22. Juli 2009 10:23