Table of Content
HAL Forum
function Boolean ReadFirstKey (
String indexname,Record NameVc Namer,Integer seg,Boolean matchflag)
Description:
Read first record by specific index from register according conditions, returns false if it is not possible to find record
Parameters:
indexname Index name
Namer Record
seg Number of used fields in index (for complex indexes)
matchflag true=exact match, false=most similar
global
procedure GetINBarCode(string item,var string res)
begin
  record INVc INr;
  record BarcodeVc Barcoder;

  res = item;
  Barcoder.Itemcode = item;
  if (ReadFirstKey("Itemcode",Barcoder,1,true)) then begin
    res = Barcoder.Barcode;
  end else begin
    if (GetFirstItem(item,INr)) then begin
      if (nonblank(INr.BarCode)) then begin
        res = INr.BarCode;
      end else begin
        res = INr.Code;
      end;
    end;
  end;
  return;
end;
Related topics:
««