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
Carolina Valentino
are the activity set as Hansamanuals said? https://www.hansamanuals.com/main/mailnumber___62526/theconf___231/manuals/version___20250224/langcode___es/hwconvindex.htm?shortcode=HW0301SETTINGS_Order...
17:20 4 Apr 2025
Paul Timms
SendWebRequest3 is a boolean function, so if this returns true and the reply header has an accepted status, you can assume that the data was sent successfully and perform some actions on the record th...
11:12 4 Apr 2025