How to prevent data to load when opening form?

GumlegufGumleguf 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_gvijay_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.
  • krikikriki Member, Moderator Posts: 9,110
    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!


  • GumlegufGumleguf 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. :)
  • suvidhasuvidha 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....:)
  • DenSterDenSter Member Posts: 8,304
    How about in OnOpenForm:
    SETFILTER("Entry No.",'<0');
    
    Of course you will need to reset that filter when the user hits the search button.
  • GumlegufGumleguf 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
  • suvidhasuvidha Member Posts: 117
    Hi,
    subformname is not a global variable.

    On the subform---> Properties-->Name:subformname needs to be specified.
  • David_SingletonDavid_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
  • GumlegufGumleguf 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
  • GumlegufGumleguf Member Posts: 38
    sudhiva -> Thanks. I'll try that and get back to you. :)
  • DenSterDenSter Member Posts: 8,304
    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.
  • GumlegufGumleguf 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.
  • GumlegufGumleguf Member Posts: 38
    Not forgotten, just put on hold until the customer gives me the go-ahead.
Sign In or Register to comment.