ReadFirstKey cannot find a record
Aldevinas Katkus
9-24-20
Operating system: macOS
I am checking for an existing invoice like this

IVr2.OfficialSerNr=inline;
if (ReadFirstKey("OfficialSerNr",IVr2,1,true))then begin
...

if inline=VPLT25790C11LT then ReadFirstKey() returns false even though such key exists. I have checked the invoices browse window - the same issue - I cannot find an invoice even it is in the list.
If I search for VPL25866 it works fine.
Is it a bug?
Swati D.
9-24-20
Hi Aldevinas

Thank you for your question. We will get you a reply asap

Swati 9.24
David Delač
9-25-20
Hi Aldevinas,

The way you described it, it sounds like you might have some corrupted data in your register. I would suggest you to do perform export/import and see if problem persists.


Best Regards,
David D.
Aldevinas Katkus
9-25-20
Data have been imported from customer's test DB. I'll try to replicate it in standard demo.
Swati D.
10-1-20
Hi Aldevinas

Is this now resolved?


Swati 1.10
Vlado Marko
10-7-20
I am not the original poster. Just one suggestion in case someone encounters this. It happens when you add a new index or modify existing index. Keep in mind indexes are not regenerated when you modify them in datadef.hal New entries which you save AFTER index modification, will have index records and you will find them, but not records before you modified the index. You need to empty and reimport the register to regenerate. There is even a last resort option which I have used in case of seriously corrupted register (--drop-register).


I do not recommend modifying existing index (key) in any way. It is best to use hal command to drop index and recreate it from scratch in datadef.hal. Then clear the register and reimport as mentioned above.

Another cause of the issue you are reporting is when your index is not unique - remember each index must contain all componentes of Main key, even if you think the index would be unique in another way.

My experience :)
Aldevinas Katkus
10-26-20
Created byVlado Marko13:14 7 Oct 2020
I am not the original poster. Just one suggestion in case someone encounters this. It happens when you add a new index or modify existing index. Keep in mind indexes are not regenerated when you modify them in datadef.hal New entries which you save AFTER
I haven't modified any index.
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
Reino Botha
Please check your version of android if it is the same as the server you are connecting too. ...
08:24 21 Nov 2024
Bror-Erik Kotiranta
In NC you hace operations>>ai chats. They are used for these Br, Bror-Erik...
05:12 21 Nov 2024