Seite 1 von 1

Dynamische Archivauswahl nach Feldinhalt

Verfasst: Freitag 23. April 2010, 12:48
von Dennis Balzuweit
Hier ein Beispiel um ein Archiv dynamisch aus einem Feldinhalt zu setzen.
Am Beispiel eines Mandanten-Feldes.

Code: Alles auswählen

Mandant := ccDocument.GetFieldValue('Mandant');

case Mandant of
  '100' : ccDocument.Destination := '/clarc/100/Example';
  '200' : ccDocument.Destination := '/clarc/200/Example';
  '300' : ccDocument.Destination := '/clarc/300/Example';
  else    ccDocument.Destination := '/clarc/999/Example';
end;

ccDocument.AllowProcessing := true;

Re: Dynamische Archivauswahl nach Feldinhalt

Verfasst: Freitag 23. April 2010, 12:59
von Dennis Balzuweit
...und ein weiteres Beispiel inkl. dem aktuellen Jahr im Archivnamen.

Code: Alles auswählen

Mandant := ccDocument.GetFieldValue('Mandant');
Year    := FormatDateTime('yyyy',Now);

case Mandant of
  '100' : ccDocument.Destination := '/clarc/100/' + Year + '/Example';
  '200' : ccDocument.Destination := '/clarc/200/' + Year + '/Example';
  '300' : ccDocument.Destination := '/clarc/300/' + Year + '/Example';
  else    ccDocument.Destination := '/clarc/999/' + Year + '/Example';
end;

ccDocument.AllowProcessing := true;