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;
....
Paul Timms
3-15-19
It seems to be a support register which is used in some supplier reports/documents, such as periodic supplier statements. I can see from the datadef that it does not get exported to the backup, so if you performed an export/import, it should rebuild that register without an entry for your new supplier. You can then try to delete the supplier again.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Hello, Kindly please report the bug so that we can further investigate and resolve it. Thank you. Best regards, Benjamin...
11:31 3 May 2024
Hi, No changes should have been made that would increase client's HDB file. Please try to delete HANSA.HDB from client folder and reconnect to server and check if it will grow to 30MB again. ...
10:14 30 Apr 2024