RecordSave() crashes
Aldevinas Katkus
1-27-22
Operating system: Windows
version 8.5 2021-04-18 (build 85360453)


I cannot figure out why
NewContactCUDsmRemote() crashes in my import procedure, but it does not if I create subcontact manually.
I am using this in the Periodic Task.

I digged out to the CUVcRecordDefaults() which uses
wn = CurWindow;
if (wn!=5) then begin
CUr.CustCat = CSb.DefCustCat;
end;

I thought, CurWindow does not work in the background thread and If I use RecordClear(ContactCUr) instead of RecordNew(ContactCUr) in the NewContactCUDsmRemote() I would get rid of this crash, but it did not help. Export-import did not help either.


updating function Boolean NewContactCUDsmRemote(record CUVc CUr,var record CUVc ContactCUr)
...
lCUr.Code = ContactCUr.Code;
if (ReadFirstMain(lCUr,1,true)==false) then begin
LogText(0,"NewContactCUDsmRemote 3 will store ContactCUr.Code=" & ContactCUr.Code);
if (RecordStore(ContactCUr,false)) then begin
LogText(0,"NewContactCUDsmRemote store success");//never executes

end else begin
LogText(0,"NewContactCUDsmRemote fail");//never executes
end;

and the results in the log are:


2022-01-27 18:28:10 /THREAD(14) NewContactCUDsmRemote 3 will store ContactCUr.Code=AK5
2022-01-27 18:28:10 /THREAD(14) Damaged database: D4DiskStore dvp!=gp->MasterDVp
2022-01-27 18:28:10 /THREAD(14) D4DiskStore
2022-01-27 18:28:10 /THREAD(14) dump of call stack
2022-01-27 18:28:10 /THREAD(14) 0000000008769C90 + 2452 halpatch\CUVcWActionTool.hal: NEWCONTACTCUDSMREMOTE
2022-01-27 18:28:10 /THREAD(14) Damaged database: D4DiskStore failed
2022-01-27 18:28:10 /THREAD(14) fide = CUVc
2022-01-27 18:28:10 /THREAD(14) D4SegmentStore failed


same with 2021-12-28 version, except the last line in the log is
2022-01-27 18:48:13 /THREAD(13) holding wrong DV

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
0 = CONr M4Long 1 = COChildNr M4Long...
11:00 8 Jan 2026
Bror-Erik Kotiranta
Hello Lilian, its been received. I myself do not know the answer to this, i will see if i can find a person who can answer your question...
10:13 8 Jan 2026