Playing with MARKEDONLY

Mauddib
Mauddib Member Posts: 269
I was playing around with MARKEDONLY and although i know there are other solutions (like adding a boolean to the Item table) I am wondering what I am doing wrong here....

OnOpenForm() for the Item list I set MARKEDONLY(TRUE);
OnAfterGetRecord I set MARK(TRUE) then in an IF Statement I set it back to false if certain criteria are met.

However when I open the form it only shows the first item in the system?

Comments

  • kriki
    kriki Member, Moderator Posts: 9,135
    This is because the OnAfterGetRecord is run on current record and gets the MARK(TRUE). And the others don't have it, so only that one is shown.
    In the OnOpenForm, you should loop the records, mark what you need and then do a MARKEDONLY(TRUE).
    The negative of this is that it can take a while before the form opens.

    So the better way would be if you have 1 field on which you can filter.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Mbad
    Mbad Member Posts: 344
    Making a field on tables just so you can sort is a bad solution.
  • kriki
    kriki Member, Moderator Posts: 9,135
    Mbad wrote:
    Making a field on tables just so you can sort is a bad solution.
    I didn't mean making a field to fill up on-the-fly for sorting.
    But a field you can fill up when inserting/modifying the record. In this case you don't lose extra time. If this does not work, the MARK-ing is the best way.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Mbad
    Mbad Member Posts: 344
    I know you didnt, Kriki, only added the comment to avoid confusion. If you can group on insert/modify on the master table it will ease the filtering.