How to prevent data to load when opening form?

Gumleguf
Gumleguf Member Posts: 38
Hi all,

I have a request to design a form containing a subform (NAV 5.01). The subform is a copy of form 29 Vendor Ledger Entries.

The thing is, that the subform should not show any data upon opening the form. Not until the user has inserted certaing search requirements snd pressed a search button, data should be shown.

I looked in the properties of both my forms, but don't seem to be able to find a way to prevent data to be loaded automatically. How do I do this?

/G

Comments

  • vijay_g
    vijay_g Member Posts: 884
    hi,
    there r multiple way to handel it i have to try for best if u could understand it clearly.
    which table used in header and what type of search button have u used. need some details.
  • kriki
    kriki Member, Moderator Posts: 9,127
    I would use a temptable in the subform.
    Create some functions in the subform that are called from the main form. These fill up the temptable of the subform to show the data.
    On opening of the form, the subform will be empty in this way. In some "refresh"-button, you can call the subform to fill up the temptable and to show it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Gumleguf
    Gumleguf Member Posts: 38
    Hi guys,

    Thanks for your replies.

    Main form is on table Vendor Ledger Entry.Button is a regular button. I have inserted a simple quick mockup showing how the window could end looking.

    Would appreciate all the help you can spare on this one. :)
  • suvidha
    suvidha Member Posts: 117
    hi Gumleguf,

    What I wud do is:
    on Openform() of header form
    --> CurrForm.subformname.VISIBLE:=FALSE;

    and OnAfterGetRecord() of header form
    -->IF "Entry No." <> xRec."Entry No." THEN
    CurrForm.subformname.VISIBLE:=FALSE;

    and OnPush() of the search button:
    --> CurrForm.subformname.VISIBLE:=TRUE;


    Hope this helps....:)
  • DenSter
    DenSter Member Posts: 8,307
    How about in OnOpenForm:
    SETFILTER("Entry No.",'<0');
    
    Of course you will need to reset that filter when the user hits the search button.
  • Gumleguf
    Gumleguf Member Posts: 38
    suvidha wrote:
    hi Gumleguf,

    What I wud do is:
    on Openform() of header form
    --> CurrForm.subformname.VISIBLE:=FALSE;

    and OnAfterGetRecord() of header form
    -->IF "Entry No." <> xRec."Entry No." THEN
    CurrForm.subformname.VISIBLE:=FALSE;

    and OnPush() of the search button:
    --> CurrForm.subformname.VISIBLE:=TRUE;


    Hope this helps....:)

    Hi suvidha,

    Thanks for your suggestion. Being a total newbie at this I tried your suggestion, but receive the following error...:

    "You have specified an unknown variable. Define the variable under 'Global C/AO symbols'.

    ...and that's strange, because I already did create a new Global Variable with Name "Name of subform", Data type "Form" and Subtype "Name of subform".

    Any suggestions? What am I missing?

    /G
  • suvidha
    suvidha Member Posts: 117
    Hi,
    subformname is not a global variable.

    On the subform---> Properties-->Name:subformname needs to be specified.
  • David_Singleton
    David_Singleton Member Posts: 5,479
    Why don;t you just teach your users how to use sort filter and search in Navision. :-k
    David Singleton
  • Gumleguf
    Gumleguf Member Posts: 38
    Hi David,

    Yes, indeed that's how you would normally work in Navision, but this is a special customer with an extensive number of customizations and some of their vendors have millions of lines, so we need a way to refine the search before openeing any posts.

    /G
  • Gumleguf
    Gumleguf Member Posts: 38
    sudhiva -> Thanks. I'll try that and get back to you. :)
  • DenSter
    DenSter Member Posts: 8,307
    Did you try my suggestion?

    So you have the main form based on Vendor Ledger Entry, and you also have a subform also based on the Vendor Ledger Entry? Why go with a subform? You could just have the main form and apply filters, that way you don't have to worry about form links, where code goes, how to call subform logic from the main form, it would be a much less complex form.
  • Gumleguf
    Gumleguf Member Posts: 38
    Hi Daniel,

    Nope, didn't try your suggestion yet, but thanks for pointing out this solution to me. I think I'll give it a test.
  • Gumleguf
    Gumleguf Member Posts: 38
    Not forgotten, just put on hold until the customer gives me the go-ahead.