Options

Request Form

KarenKaren Member Posts: 79
I've a problem in my report.
When I get the request form and do a lookup to get a filter and return back to my request form. The filter isn't filled in.
Only when I put the focus on the next line and return back to the line with my lookup, the filter will be filled in.

How can I resolve this?

Comments

  • Options
    micheldoggermicheldogger Member Posts: 21
    I think is has something to do with the UPDATE of the form.
    As I read your text your field is already filled but you have to
    focus again on that field to update is. Maybe you can solve it
    bij placing a CurrForm.UPDATE on te validate trigger of that field,
    or after resolving the filter in your code (if the code is on your Form)
  • Options
    KarenKaren Member Posts: 79
    But I've written the code in the table (onlookup of the field). Here I can't do a update,...

    And I can't write it in a form because it is in my request form

    :cry::cry::cry:
  • Options
    KarenKaren Member Posts: 79
    Can anyone please help me!!!

    [-o< [-o< [-o<
  • Options
    DenSterDenSter Member Posts: 8,304
    Ah so you want to have the filter applied right when you return from the lookup form? Why is it so important to have that happen at that very moment? You can't do anything else until after you leave the field anyway.

    That is simply the way that Navision filters work, you can't make it behave differently. First you look something up, and then you validate it.
  • Options
    KarenKaren Member Posts: 79
    I just want to fill in the field of the filter in my request form.
    If I lookup the value for my filter. The filter isn't filled in right away when I press OK.
    I need to put the focus on the next field and then back to the first field before the value that I looked up is filled in.

    I just need to UPDATE my request form in some way!!!
  • Options
    KarenKaren Member Posts: 79
    This is the code I used in the onlookup function of the field.

    CLEAR(lookupform);
    ...
    lookupform.SETTABLEVIEW(..);
    lookupform.LOOKUPMODE(TRUE);
    IF lookupform.RUNMODAL = ACTION::LookupOK THEN BEGIN
    SETFILTER(Klachtnummer, lookupform.GetFilter());
    END
  • Options
    KarenKaren Member Posts: 79
    I used the following code in the lookupform:


    CurrForm.SETSELECTIONFILTER(..);
    txtFilter := ..
    ...



    GetFilter() p_filter : Text[260]
    p_filter := txtFilter;
  • Options
    DenSterDenSter Member Posts: 8,304
    I don't think it is possible the way you describe. You have to leave a field to validate its value, that's just the way Navision works...
  • Options
    KarenKaren Member Posts: 79
    But in other lookup fields, the value is automatically filled in when you close the lookupform. So this must be possible too.
  • Options
    PellePelle Member Posts: 18
    karen, let's take this from the beginning.

    You shouldn't need any code at all.

    When you say "look up field", do you mean a textbox on the
    option tab of the request form?

    In that case,
    set the source property of the textbox to "table name"."table field"
    example: MyItem."No."

    Set the TableRelation property of the textbox to the table name of the
    table you want to look up in. Note: the "real" table name, not the name
    of your defined variable. Example: Item

    No code!

    Done. //Pelle

    //Pelle
  • Options
    KarenKaren Member Posts: 79
    I did not made a request form myself.
    I just filled in the following property of my dataitem:
    ReqFilterFields

    And this field is a lookup field.
  • Options
    PellePelle Member Posts: 18
    Karen wrote:
    This is the code I used in the onlookup function of the field.

    CLEAR(lookupform);
    ...
    lookupform.SETTABLEVIEW(..);
    lookupform.LOOKUPMODE(TRUE);
    IF lookupform.RUNMODAL = ACTION::LookupOK THEN BEGIN
    SETFILTER(Klachtnummer, lookupform.GetFilter());
    END

    Try to remove the code. //Pelle
  • Options
    KarenKaren Member Posts: 79
    But not all of the data in the form may be shown.

    Therefor I put this code.
Sign In or Register to comment.