Filter Stuck

Hi,

I have this recurring issue with user A setting up a filter on purchase order screen, user B post / delete the document. once user A opens the form he won't be able to use it as he get an error stating "the Purchase header does not exist......". I know that deleting the ZUP file will reset the filters, but it will also reset all user preferences.

Any solution around this ?
Rani Shoura

Answers

  • krikikriki Member, Moderator Posts: 9,096
    Try recompiling the form-object. Otherwise change the datetime of the form-object.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • RaniShouraRaniShoura Member Posts: 34
    This would help but doing that will reset any user preferences on the form
    Rani Shoura
  • vaprogvaprog Member Posts: 1,118
    You can use code like the following in OnFindRecord
    Found := FIND(Which);
    IF Found EXIT(TRUE);
    IF HASFILTER THEN
      IF Count = 0 THEN BEGIN
        fg := FILTERGROUP;
        FILTERGROUP(10);
        WHILE HASFILTER DO
          FILTERGROUP(FILTERGROUP+1);
        View := GETVIEW; // the view contains the sort order (key) only
        FILTERGROUP(fg); // reset the filter group
        SETVIEW(View);
        Found := FIND(Which);
      END;
    EXIT(Found);
    
    Found : Boolean;
    fg: Integer;
    View: Text[1024];
    

    This clears all filters in the current filtergroup, preserving the key.
Sign In or Register to comment.