Filter transfers between company

br@mc
br@mc Member Posts: 16
Hi,

We have some strange filter behaviour when switching companies.
If we set a filter in company A it gets transferred to company B. Opening a document there results in an error because the document doesn't exist in company B. Sometimes the filter refers to a document that doesn't exist anymore in Company A.

It is even worse when you set a filter on a document and delete the document by a batch job. In this case we can't open the document in neither company.

It seems like the filter functionality i somehow messed up.

Yes, we use a DB with a lot of modifications but we can't locate the problem.

Has anyone experienced simular problems?
Where is de filtering stuff handled in Navision.

Deleting the zup file or recompiling the form 'solves' the problem.

regards

bram

Comments

  • kriki
    kriki Member, Moderator Posts: 9,132
    This is standard behaviour.
    You can fix it by not saving the filters in the zupfile.
    => Form-Property SaveTableView=No
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • br@mc
    br@mc Member Posts: 16
    No it's not standard. If the record doesn't exist in an other company the form does open in standard Navision.

    We just found what causes our problematic behaviour.

    Apparently if you call the subform in the OnOpenForm Trigger of a Form the Filter functionality gets mixed up!

    //OnOpenForm
    CurrForm.SalesLines.Ypos;

    Does anyone know why you can't address a subform.control? and what it has to do with setting filters?

    If you want to test (we're running a 3.70 sql DB, same result for 3.7 native):
    add the above line of code on a form, set a filter on a record and switch to another company where the doc no doesn't exist.

    If you wonder why we do this :-). We made some resize functionality so users can expand or shrink the lines of their document forms. Some simple code but with bizarre result.


    regards


    b
  • kriki
    kriki Member, Moderator Posts: 9,132
    Some controls of a subform can be addressed, but your control needs a name. If the control is a field of the table of the form, it takes a name automatically. If not, you need to use the name-property of the control.

    Did you try the property SaveTableView=No?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • br@mc
    br@mc Member Posts: 16
    Maybe I didn't make myself clear.

    If you add CurrForm.SalesLines.xxx on the OnOpenForm trigger of a form the filter functionality gets buggy when switching companies.

    Everything works fine again. The only thing I changed was this :

    OnOpenForm
    //ADP BCO ADP10271 (20122006) nB
    //intDefaultSalesLineYpos := CurrForm.SalesLines.YPOS;
    //ADP BCO ADP10271 (23012007)
    intDefaultSalesLineYpos := 9570;
    //ADP BCO ADP10271 (20122006) nE


    I don't want to turn of the savetableview property.
  • kriki
    kriki Member, Moderator Posts: 9,132
    Try in the OnOpenForm (try before or after your current code):
    IF NOT FIND('=') THEN BEGIN
      RESET;
      IF FINDFIRST THEN ;
    END;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!