Codeunit to hide blank records

liizzliizz Member Posts: 125
Hi all,

I have to put a filter on a form, the Customer List, i.e where Name & Contact fields are left blank. These records should be hidden. We are not allowed to delete them.

I have a table filter on the Customer List form, but it doesnot allow me add a new customer. Its not a gud idea..

I have written a codeunit but am not knowing of how to not show these dummy records instead of deleting them..
Can anybody suggest solutions??

Please advise..

Thanks
Liizz

Comments

  • GRIZZLYGRIZZLY Member Posts: 127
    If you are faced to the filter, which cannot be simply setted by SETFILTER command because of compound condition, then you could mark those records you wanted to show by MARK(TRUE) and then calling MARKEDONLY(TRUE).
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • matttraxmatttrax Member Posts: 2,309
    GRIZZLY wrote:
    If you are faced to the filter, which cannot be simply setted by SETFILTER command because of compound condition, then you could mark those records you wanted to show by MARK(TRUE) and then calling MARKEDONLY(TRUE).

    I don't believe that is the problem. I'd imagine what happens is that you insert a new customer, but when you do that the name is blank so it is automatically filtered out. Why can't you just block the customers? Why do they have to be filtered out?

    What will happen if someone accidentally blanks out the name field? They would never be able to get that customer back without some sort of intervention by technical support. I don't think that it is the correct solution to your problem.
  • liizzliizz Member Posts: 125
    Thanks for ur posts.

    This is because the system wants to keep track of those blank records.

    The table filter that I created on name should not be blank, am not able to make on F3 on the Contact card.

    Plz help..

    Thanks
    Liizz
  • SogSog Member Posts: 1,023
    set the form/page's property delayedinsert on true and try it out.
    It will insert the record after the user moves to another record instead of inserting it when the primary key is filled out.
    That way the filter will only have effect when the record has been inserted.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.