Options

Using getfilter on "onopenpage" Trigger

Dean_AxonDean_Axon Member Posts: 193
edited 2012-06-28 in NAV Three Tier
Hi All;

I need some guidance or maybe some idea of how 2009 r2 is dealling with this.....

I have the following code in the OnInit() and OnOpenPage() triggers of the item list page (31)
Message(GetFilter("My Filter"));
But no matter which trigger I place this code in, the message returns no value.

However, the list IS filtered by "my filter" as the returned results are filtered.

The List page itself is called from the Lookup of the "No." field on the purchase order page with the filter applied to the TABLERELATION something like this.
IF (My Field=CONST(Yes),Type=CONST(Item)) Item WHERE (My Filter=CONST(Yes))

ANY IDEAS ???? ](*,)

TIA

Dean
Remember: Keep it simple

Comments

  • Options
    udayrmerudayrmer Member Posts: 171
    You can not use FlowFilter Field in this way, i.e. in table relation, you have to use SETFILTER to set Filter, Because it is not stored in record. as well as FlowFilter used to Filter Values, or calculate Fields, not for FIlter records.
    Uday Mer | MS Dynamics NAV Techno-Functional Consultant
  • Options
    geronimogeronimo Member Posts: 90
    you have to change the filtergroup before the getfilter command.

    so for example
    filtergroup(2);
    message(getfilter("field on which has been filtered");
    filtergroup(0);
    

    you'll have to check the help on which filtergroup to use, the used filtergroups go up to 6 in c/side.
  • Options
    Dean_AxonDean_Axon Member Posts: 193
    Hi Guys,

    Thanks for the 2 suggestions so far:

    Uday - It works in classic client in the OnOpenForm() trigger, so i was hoping that the Page type object did the same in OnOpenPage() [-o<

    Geronimo - Unfortunately this did not make any difference by using filtergroups first. :(

    Dean
    Remember: Keep it simple
  • Options
    thegunzothegunzo Member Posts: 274
    Hi Dean

    In Pages you might need to use FILTERGROUP(4) to see the filter in the OnOpenPage trigger.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    vijay_gvijay_g Member Posts: 884
    I don't think the role of Filtergroup in this case, Different filtergroups are used that how you are applying filter to a record pointing to the table with which you want to work.
  • Options
    Dean_AxonDean_Axon Member Posts: 193
    Hey Gunner,

    I've tried 1 through 6 (just for testing) and none of them gave me the results :x

    Having re-read the help file, I would have expected 4 to work ???

    Thanks

    Dean.
    Remember: Keep it simple
  • Options
    thegunzothegunzo Member Posts: 274
    Well Dean, at least it has worked for me.

    How do you apply the filter before opening the page ?
    If you are using RunFormLink for page this should be filtergroup 4.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Have you already checked the "About this Page"?
    In tab "Filters" you should be able to see at which level the filter is placed.
    ~Rik~
    It works as expected... More or Less...
  • Options
    udayrmerudayrmer Member Posts: 171
    Hi Dean,

    may i know "My Filter" is FlowFilter or normal Field ?
    Uday Mer | MS Dynamics NAV Techno-Functional Consultant
Sign In or Register to comment.