Table of Content
HAL Forum
procedure ImportOneRecord (
var record AnyRecord,string TagName)
Description:
Imports one record from the import file using one of the predefined importing procedures.
Parameters:
AnyRecord Record variable that will receive the values from the file that is being imported.
TagName Uses importing procedure ReadImportTag[TagName]
global
updating procedure ReadImportTagBPhoneCUVc()
begin
  record MailReadVc MRr;
  record MailVc Mailr;
  
  record UserVc Userr;
  record CUVc CUr;
  record CUVc curCUr;
  Integer action;
  Boolean found;
  string 255 tstr;
  
  while (NextImportLine(false)) begin
    action = 0;
    found = false;
    RecordNew(CUr);
    ImportOneRecord(CUr,"cu3");
    if (nonblank(CUr.Code)) then begin
      if (nonblank(CUr.SkypeName)) then begin
        curCUr.SkypeName = CUr.SkypeName;
        if (ReadFirstKey("SkypeName",curCUr,1,true)) then begin
          goto LSKIP;
        end;
      end;
      if (nonblank(CUr.VATNr)) then begin
        curCUr.VATNr = CUr.VATNr;
        if (ReadFirstKey("VATNr",curCUr,1,true)) then begin
          goto LSKIP;
        end;
      end;

      Userr.Code = CUr.SalesMan;
      if (ReadFirstMain(Userr,1,true)) then begin
        CUr.SalesMan = "";
      end;
      
      curCUr.Code = CUr.Code;
      if (ReadFirstMain(curCUr,1,true)) then begin
        action = 1;
        found = true;
      end;
      
      switch (action) begin
        case 1:
          if (GetNextCustNr(tstr)) then begin end;
          CUr.Code = tstr;
      end;
      if (RecordImportStore(CUr,false)) then begin end;        
LSKIP:;      
    end;
  end;    
  
  return;
end;
Related topics:
««