Index: ProScan/UI/DnaCodeScherm.pas =================================================================== diff -u -r669 -r675 --- ProScan/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 669) +++ ProScan/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 675) @@ -240,7 +240,9 @@ if UiContext.LaatsteDnaCode = '' then exit; - if StartsText('O1',UiContext.Pallet) then begin + if UiContext.Pallet = '' then begin + result := 0; + end else if StartsText('O1',UiContext.Pallet) then begin fAgent := TAgent.Create(UiContext); fZoekAlleVhossLadesBijDnaCodeResponse := fAgent.ZoekAlleVhossLadesBijDnaCode(UiContext.LaatsteDnaCode); fAgent.Free; @@ -864,11 +866,15 @@ fZoekViaPalletCodeResponse: ZoekViaPalletCodeResponse; fAantal: integer; begin - fAgent := TAgent.Create(UiContext); - fZoekViaPalletCodeResponse := fAgent.ZoekViaPalletCode(PalletCode); - fAgent.Free; - fAantal := length(fZoekViaPalletCodeResponse.DnaCodes); - fZoekViaPalletCodeResponse.Free; + if (UiContext.MoetTbpCodeGenereren = true) then begin + fAantal := 0; + end else begin + fAgent := TAgent.Create(UiContext); + fZoekViaPalletCodeResponse := fAgent.ZoekViaPalletCode(PalletCode); + fAgent.Free; + fAantal := length(fZoekViaPalletCodeResponse.DnaCodes); + fZoekViaPalletCodeResponse.Free; + end; Result := fAantal; end;