VSVc register
Christoffer Riska
3-14-19
What is this register used for?

We have a situation where a supplier was registered in CUVc. After the record was saved a new purchase invoice was registered.
Then the invoice was removed, but the supplier cannot be removed from CUVc.
Hansa gives an error (2175) that the supplier cannot be removed.

The register CUVc is not a shared register.

After looking at the HAL code I can see that "function LongInt CUVcRecordCheck" in CUVcRAction.hal calls function Boolean VSVcExists. See code below.


function Boolean TestVSVcExists(string cucode,Boolean pof)
begin
Boolean res;
record VSVc VSr;
record POVc POr;
record PUVc PUr;

VSr.VECode = cucode;
res = ReadFirstMain(VSr,1,true);
if (res==false) then begin

if (pof) then begin
POr.VECode = cucode;
res = ReadFirstKey("VECode",POr,1,true);
if (res==false) then begin
PUr.VECode = cucode;
res = ReadFirstKey("VECode",PUr,1,true);

end;
end;
end;
TestVSVcExists = res;
return;
end;

function Boolean VSVcExists(string cucode,Boolean pof)
BEGIN
Boolean res;
string 255 sharedincomp,comp;

Integer curcomp;
Integer pos;

if (RegisterIsShared("CUVc")) then begin
sharedincomp = RegisterInSharedSetting("CUVc");
if (nonblank(sharedincomp)) then begin
curcomp = CurrentCompany;

pos = 0;
ExtractObj(sharedincomp,pos,comp);
while (nonblank(comp)) begin
if (SetCompany(StringToInt(comp),false)) then begin
// if (SetCompanyCode(comp,false)) then begin
res = TestVSVcExists(cucode,pof);
if (res) then begin
ResetCompany(curcomp);
goto LVSVcExists;
end;
end;
ExtractObj(sharedincomp,pos,comp);
end;
ResetCompany(curcomp);

end;
end else begin
end;
res = TestVSVcExists(cucode,pof);
LVSVcExists:;
VSVcExists = res;
return;
end;

....
if ((CUr.VEType==0) and (CU2r.VEType!=0)) then begin
if (VSVcExists(CUr.Code,false)) then begin
RecordCheckError(2175," " & CUr.Code,-1,"Code");
res = -1;
goto LCUVcRecordCheck;
end;
end;
....
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Latest Posts
Bror-Erik Kotiranta
I will have a programmer answer this one, I do not have the full answer for this...
14:23 25 Jan 2025
Bror-Erik Kotiranta
I meant that file you were looking it, forgot the actual name sorry about that. But that file, if you change the IP to the correct one, does it then connect?...
14:21 25 Jan 2025