AppendMatrixFieldToKeyName
Paul Timms
3-14-17
In some datadefs, AppendMatrixFieldToKeyName is used to allow searching for a record containing a particular matrix field, without having to loop through the rows. For example, POVc has this index:


SubsetKeyBegin2(ActArtCodeOSFlag);

StoreInBaseKey;
AppendMatrixFieldToKeyName(ArtCode,0);
KeySegment(SerNr);


I have written a procedure which loops through POVc looking for those containing a specific item, but it returns no results even though I have a purchase order with the specified item. Below is the code I am using. Any idea what might be wrong?

TrHs = true;
index = "ActArtCodeOSFlag:" & INr.Code;
ResetLoop(POr);
while (LoopKey(index,POr,1,TrHs)) begin
if (TrHs) then begin

trace(POr.SerNr,POr.TransDate);


Thanks

Paul
Jarek Jamroszczak
5-12-17
Hello

Do you do anything with ActArtCodeOSFlag index ?
or datadef and above loop are only places with ActArtCodeOSFlag ?


Regrads

Jarek
Christoffer Riska
7-30-17
Hi,
Maybe try this:
index = "ArtCode:" & INr.Code;

Regards,

/Chris
Erik Elmgren
8-24-17
Note that this index is still an index on the SerNr field. So you should start with that as -1.

Note also the following code in master:


function LongInt ORVcRecordInIndex(record ORVc ORr,string indexname)

if (ORr.OSFlag==0) then begin
if (indexname=="ActArtCodeOSFlag") then begin res = 0; end;
end;

So only records with OSFlag <> 0 will be listed in that particular 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
Hello, Bug has been verified and assigned to a programmer. We will push to be done as soon as possible. Thank you. Best regards, Benjamin...
15:48 9 May 2024
Hi, No changes should have been made that would increase client&apos;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