Table of Content
HAL Forum
function integer CheckObjs (
string Account,string Objects,var string ErrorRef)
Description:
Verifies that all the object codes in the string based value list have been registered in the company and determines if all the Retu object types for certain acoount have been covered. Returns an error code if an error occured (0 = no error).
Parameters:
Account Account code that will be used to check if an demanded object of certain type is in the list.
Objects List of objects (eg. "OBJ1,OBJ2,OBJ3")
ErrorRef Returned object code that refers to the object that was errondeous.
external function Integer CheckObjs(string,string,var string);

global
procedure SetTRObjectRows(var record TRVc TRr)
begin
  record CYBlock CYb;
  record ObjVc Objr;
  record ObjVc Obj2r;
  row TRVc TRrw;
  Integer i,j,rwcnt;
  string 255 errstr;
  string 60 preobj;
  Array string 20 ac;
  
  BlockLoad(CYb);
  if ((Importing==false) and (nonblank(CYb.Object))) then begin
    j = 0;
    SplitEclass(CYb.Object,ac);
    while (nonblank(ac[j])) begin
      Objr.Code = ac[j];
      if (ReadFirstMain(Objr,1,true)) then begin
        rwcnt = MatRowCnt(TRr);
        for (i=0; i<rwcnt; i=i+1) begin
          MatRowGet(TRr,i,TRrw);
          if (SetInSet(Objr.Code,TRrw.Objects)==false) then begin
            TRrw.Objects = AddObjectToObjectList(TRrw.Objects,Objr.Code);        
            if (CheckObjs(TRrw.AccNumber,TRrw.Objects,errstr)==0) then begin
              MatRowPut(TRr,i,TRrw);
            end else begin
              TRrw.Objects = Objr.Code;
              MatRowPut(TRr,i,TRrw);
            end;
          end;
        end;
      end;
      j = j + 1;
    end;
  end;
  return;
end;
Related topics:
««