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
Andis Blicāns, Grasko
Hi, We have client using 8.5 2021-09-26 (build 85400383). The fields &quot;Max Web Users&quot; and &quot;Max Sessions&quot; ar blank. Server is closing itself almost every day. Message in hansa....
15:52 26 Apr 2024
Afternoon, Some of our customers haven&apos;t changed their passwords for a while but they&apos;re not getting any password expiry message. If I copy their Standard ID into a new user on some test ...
17:22 25 Apr 2024