MARKEDONLY doesn't show all records

I build a Form with a Lookup on Location Code. After the Lookup the Rec will be filtered with this Location Code using the FILTERGROUP functionality (I change to FILTERGROUP=1 when setting the Location Filter on Rec). Also in the AfterGetRecord-Trigger their will be set a MARK on the record if a condition is TRUE.
The effect is that when not all records could be shown in the current window and I change to MARKEDONLY only those MARKED-Records which were visible in the Table Grid are filtered. When I frist scroll down all the records and then set MARKEDONLY all MARKED-Records will be shown. I tried different solutions with FIND and CurrForm.UPDATE(FALSE) but nothing helps. Any ideas ?

Why do you need this to be filtered by marked Only ?

Is there something you change in the line in order to get it marked ? You were talking about a condition. Could you be more precise on that ?

The better solution would be to already “mark” the record directly after you have filtered them in code.

This means that you would do your

… // Apply some filters
… // Do some checks
IF ConditionYes THEN

This should “pre mark” the records and you would not need to do it on the “OnAfterGetRecord” trigger.

Even though that I would use FILTERGROUP(2) instead of FILTERGROUP(1) [;)]

Yeah -

Tell me WHAT you need - NOT HOW it should be done [:D]

-I keep telling my customers that!

It is a kind of Inventory Control Form. I have a temporary Table in which I insert records with Item No. and a quantity given from a System outside of Navision. The Tables Form filters the Table on a special Location using FILTERGOUP. The user chooses the Location via Lookup. The Form itself should then show the Navision quantity in a third column beside the Item No. and the given Outside Quantity.The Navision Quantity must be calculated on demand when opening the Form. I solved this with a global variable for the Navision Qty. Column and a FlowFilter on Item’s Quantity in OnAfterGetRecord. I want to give a possibility to filter records with different quantitys on Button Push. So I mark all the records in the OnAfterGetRecord after calculating the Navision Quantity and compare it with the Outside Quantity. The alternative could be to filter the records on Push Button Trigger but I am interested in the problem :slight_smile:

OK my problem was that I missunderstood the OnAfterGetRecord()-Trigger. I is only fired for those records which are shown in the current Form. So Navision does it right when it only shows me the marked records I see in the Form Window. Thx for help!

How (and where) do you store the “Outside” quantities ?

Wouldn’t a flowfield on the item card summing up the entries in that table according to the “Location Filter” field do what you want without dealing with temporary records and/or marking records at all ?

How many items are we talking about ? If it is more then a few hundred it will take ages to compile the temporary item list.

As far as I understand you want to show a list like the following:

Item No.
Outside Qty.

for a specific Location Code. Is that understanding correct ?

The table is a copy of the Item Journal Line and is filled via a custom XML Import. Because this table is also used for importing Reclass Item Journal Lines and some other EDI Data I try to not add more fields than those I need for my additional EDI Check Routines. The user works on these “Temporary Tables” (you can also say “Inbound” or “Incoming”) before creating real Navision Records out of the EDI Data. Another problem might be that I delete most of the Validation, Lookup and FlowField Code in these tables to import as most of the EDI Data I can. Because the Import is done by the NAS I want to let errors be fired by User Actions and not when the NAS is trying to insert / modify records.