Refresh Form List

couberpucouberpu Member Posts: 317
Good Morning,

I used RESET, SETCURRENTKEY, SETRANGE and SETFILTER to gather a set of sales orders to list in a new form. I then added a function "Line" to get into each order and make changes. After the change was made, some of the orders no longer meet the SETFILTER condition and need to be took off the list. But when I returned back to the list, it became blank. Not only the one need to be took off was not on the list but every order was gone. I had to close out the form and reopen the form again to get them back on the list, without the one I just changed.

Please help me on how to make the list do a proper refresh without the need to close out he form and reopen it.

PS. CurrForm.UPDATE does not help.


Thanks,
CouberPu

Answers

  • garakgarak Member Posts: 3,263
    edited 2008-11-23
    mhm, how look your code.
    My interest is here: How you set the filter (where, in which trigger) and what is the code behind your button. So somewhere must the filter be changed.
    Do you make it right, it works too!
  • David_SingletonDavid_Singleton Member Posts: 5,479
    couberpu wrote:
    Good Morning,

    I used RESET, SETCURRENTKEY, SETRANGE and SETFILTER to gather a set of sales orders to list in a new form. I then added a function "Line" to get into each order and make changes. After the change was made, some of the orders no longer meet the SETFILTER condition and need to be took off the list. But when I returned back to the list, it became blank. Not only the one need to be took off was not on the list but every order was gone. I had to close out the form and reopen the form again to get them back on the list, without the one I just changed.

    Please help me on how to make the list do a proper refresh without the need to close out he form and reopen it.

    PS. CurrForm.UPDATE does not help.


    Thanks,
    CouberPu

    The problem is generally where you are calling the function from. Its the sort of thing that needs the specific code, but for example, if you call the function on a particular record, and that record the after updates no longer meets the filters, then it would act as you suggest.

    The solution is generally to either call the function from the form directly, or to make sure that you exit from a record that is still within the filter set.

    often just adding a line like IF FIND('-') THEN ; can resolve the issue.

    note also that what you are trying to do will almost certainly NOT work on a subform, so if its a sub form you are going to have to do the code in the main form and then update that way.
    David Singleton
  • couberpucouberpu Member Posts: 317
    Garak and David,

    Thanks for your help. =D> =D>

    I edited and edded the filters in OnFindRecord trigger and now it is working.

    Thanks,
    CouberPu
Sign In or Register to comment.