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
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&gt;&gt;ai chats. They are used for these Br, Bror-Erik...
05:12 21 Nov 2024