Options as Flowfilters

Demonic240Demonic240 Member Posts: 65
Hi,

I have a flowfilter on a form that is an option. You can manually type in one of the options and it will accept it and filter. However, if you try to select from the option menu it gives you a blank item. Is there a way to make sure which ever option you select is inserted into the filter?

Comments

  • Alex_ChowAlex_Chow Member Posts: 5,063
    Demonic240 wrote:
    Hi,

    I have a flowfilter on a form that is an option. You can manually type in one of the options and it will accept it and filter. However, if you try to select from the option menu it gives you a blank item. Is there a way to make sure which ever option you select is inserted into the filter?

    What is this option menu you're referring to?
  • Demonic240Demonic240 Member Posts: 65
    I have 3 flowfilters as fields on a form. One of the flowfilter fields is of the option type since it relates to an option field on the table. You can click the box to expand the selection but you can't select any of the options. You can however, type in the options.
  • SavatageSavatage Member Posts: 7,142
    I'm not following this - perhaps you can be clearer.

    You've created a Flowfilter or flowfield?
    of an option Type from another table?

    Do you wan't it to lookup something?
    You wan't to be able to change?

    Your flowfiltering on these options? Why would the options change if you're filtering on it?

    Perhaps you can start again..with the goal you're trying to achieve.
  • Demonic240Demonic240 Member Posts: 65
    I have 3 flowfilters types phsyically on my form. I also have a flow field on my form (you helped my fix that one). The flow field displays a COUNT = to what is filtered from the flowfilters. The first flowfilter is of type Integer and relates to the mileage on the vehicle table. The third flowfilter is of type Code and relates to the Global Dimension 1 Code of the Vehicle table (aka Div/Dep). The second flowfilter is of type Option because it relates to the Type field (Type field is an option field with 6 different choices of vehicles). The only way I can make the form open is by having the Type Filter (filter 2) as an Option type. I want a user to be able to click on the dropdown button and be able to select one of the options. Currently it does not input anything into the filter if you try selecting one, you have to type it in. (Sorry if it doesn't make sense but I guess it isn't done often)
  • SavatageSavatage Member Posts: 7,142
    ok so you want 3 filters (bsically) and depending on what the user puts in these 3 filters you want some results to be displayed.

    1) Mileage
    2) Div or Dep
    3) PickUpTruck, Van, LuxCar, EconCar, SUV, Other (Just an as example)

    So if the User picks Mileage 1..100 (i'm assuming you want a range)
    then Div
    then Van

    You want all the Vans that fit the other criteria to show on your list with a count?

    Not sure if this is similar but I needed to do something kind of the same.
    which required filtering on a list to find what I needed.
    1) was A Ship-to Zip Code 2) Was an Order Weight & 3) would find the rate.

    It was accomplished here:
    http://www.mibuso.com/forum/viewtopic.php?t=17866

    Take a look at that and see if it gives you any ideas else I will try to get back to you tomorrow.
    PS here's another post from the download section called Filter Anything on Forms.
    http://www.mibuso.com/dlinfo.asp?FileID=515
  • ufukufuk Member Posts: 514
    If you really want to use flowfilter (filter the values in record, not the record itself) then try using a option type variable instead of flowfilter itself. Option type flowfilters have this problem (option value disappears when it is placed on the form).

    If you don't want to use built-in filter menu then first create an option type variable with the same options of your flowfilter.
    Then write your code on OnValidate of the form like:

    SETRANGE("Option Filter",OptionFilter);

    But if the user also uses built-in filter menu then you have to use GetFilter on OnAfterGetCurrentRecord. (if not, your option variable does not always reflects the user's selection)
    Ufuk Asci
    Pargesoft
  • Demonic240Demonic240 Member Posts: 65
    Savatage wrote:
    ok so you want 3 filters (bsically) and depending on what the user puts in these 3 filters you want some results to be displayed.

    1) Mileage
    2) Div or Dep
    3) PickUpTruck, Van, LuxCar, EconCar, SUV, Other (Just an as example)

    So if the User picks Mileage 1..100 (i'm assuming you want a range)
    then Div
    then Van

    You want all the Vans that fit the other criteria to show on your list with a count?

    Couldn't have explained it better myself (no really, I couldn't) However, the filter works. It's just displaying the options in the flowfilter. I believe Ufuk might be on to something. I don't doubt that his will work, but will it work with a COUNT on the form?
  • ufukufuk Member Posts: 514
    Couldn't have explained it better myself (no really, I couldn't) However, the filter works. It's just displaying the options in the flowfilter. I believe Ufuk might be on to something. I don't doubt that his will work, but will it work with a COUNT on the form?

    Flowfilter does not effect on the record count. The records remain but the values change. So what do you mean by work with the Count of the form?
    Do you count some records effected by the option type flowfilter?
    Ufuk Asci
    Pargesoft
  • Demonic240Demonic240 Member Posts: 65
    Yes, the COUNT is counting the number of records that are displaying when using the flowfilters.
  • ufukufuk Member Posts: 514
    Again I have to say that flowfilter has no effect on the count of rec. If you apply it or not, the record count is always same. It is different from Setrange or Setfilter etc.

    So if you sure about using a flowfilter then there is no problem with using a variable instead of flowfilter itself.
    Ufuk Asci
    Pargesoft
  • SavatageSavatage Member Posts: 7,142
    How do you have your form set up?

    You might want to look at the forms in g/l

    Chart of Accounts->Balance-> Gl Balance or G/l balance by dimension.
    look at the code behind those forms. It set up for multi-filters with options.
  • Demonic240Demonic240 Member Posts: 65
    This is the CalcFormula for my flowfield.
    [code[Vehicle Count:
    Count(Vehicle WHERE (Mileage=FIELD(FILTER(Mileage Filter)),Global Dimension 1 Code=FIELD(FILTER(Div/Dep Filter)),Type=FIELD(FILTER(Type Filter))))[/code]

    I was able to make a new field on the form and linked it to a variable option that then did a SETRANGE("Type Filter",variable);
    Doing that allowed me to make the option field changeable and also populated the flowfilter.
Sign In or Register to comment.