Problem with MARKEDONLY

famelifameli Member Posts: 5
hi,

on the OnOpenForm trigger of a form based on Item table, I mark some records, per:
Item.MARK(TRUE);

At the end of the code I set the MARKEDONLY true, per:
Item.MARKEDONLY(TRUE);

But the Form shows me all the records existing in item table.

Does somebody knows what's wrong with my Form?

Thanks
Farshid

Comments

  • BeliasBelias Member Posts: 2,998
    first of all, make sure you're filtering the same variable you are showing in the form. also see if there is any reset/clear in wrong places
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • famelifameli Member Posts: 5
    1. what do you mean by "filtering the same variable showing in the form"?

    2. reset/clear is not used in code.
  • BeliasBelias Member Posts: 2,998
    example:
    -sourcetable property of the form = Customer
    -my code in onopenform:
    ...
    recMyCustomer.mark(true);
    ...
    recMyCustomer.markedonly(true);
    

    in this case, you're filtering the wrong variable, you should use mark and markedonly on "Customer" variable(omittable, as it is the sourcetable).
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kinekine Member Posts: 12,562
    Source variable for Form is always Rec variable. You need to set the filter on it. But, of course do not forget about the performance issues on MS SQL etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • BeliasBelias Member Posts: 2,998
    maybe i was(or were?...sorry I don't remember :oops: ) misunderstood because of my english...
    surely sourcetable is always rec...
    But, of course do not forget about the performance issues on MS SQL etc.

    if you are in 5.0 or 5sp1 you can also use a "temporary" sourcetable
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.