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
Lilian Wanyoike
Hi, Spinners & Spinners are currently on version 8.5 2022-02-02 (build 85420830). they have been experiencing a network lag. Action taken: - Checked logs and confirmed that they had not whiteli...
14:13 30 Aug 2024
Lilian Wanyoike
Hi, Spinners & Spinners are currently on version 8.5 2022-02-02 (build 85420830). they have been experiencing a network lag. Action taken: - Checked logs and confirmed that they had not whiteli...
14:13 30 Aug 2024