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
Piotr Wycichowski
Thanks Gatis, anyway it seems to be reported as bug instead of wish because now it depends on who created task for whom, am I right? /Piotr W....
14:39 15 May 2024
Aldevinas Katkus
Actually a new version of this bug is SL&gt;&gt;Reports&gt;&gt;Periodic customer statement &quot;accumulates&quot; amounts Not sure why it was duplicated, I clicked &quot;submit&quot;only once....
08:09 10 May 2024