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
David Delač
Hi Piotr, The log entry:
2024-12-14 08:40:43 0.000 CallHal(IsHansaWorldCustomer) appears because the server is running with the verbosity=debug-detailed setting in its parameters.txt file. Thi...
09:43 16 Dec 2024
Brittany McGrath
Hi Vaughn, I can confirm this has been fixed now and is live in Standard ERP 2024-11-20 Version: 85556786. Thank you. ...
10:04 10 Dec 2024