global variables dissappearing in form

leeluhleeluh Member Posts: 3
Hi all!

I have a question for you to answer with your (hopefully) immense brainpower, because this is driving me nuts:

I'm working in a new module for seminar management. In order to create/delete new bookings in range for training resources (like classrooms, for instance), I made a mixed form, with a design similar to a header-lines form, but being actually a tabular form with a tab on top containing several textboxes (whose source are global variables) where the user can define a series of criteria in order to create bookings, such as starting and ending dates, days of the week in which the seminar takes place, etc. In the tabular section of the form appear the already existing bookings, which get filtered dynamically according to the criteria that the end user selects, so that the user can be if there are other bookings that overlap with the ones he/she wants to create.
Until this point, everything ok. What intrigues me is that, if the form loses its focus, like when another form is opened, when it is activated again it only shows the global variable values in the textboxes WHEN THERE ARE RECORDS IN THE TABULAR SECTION. In other case, the form appears empty. BUT if the user positions the cursor on one of the textboxes it displays the current value of the source variable associated. AND if the user clicks a checkbox, or a radiobutton, or a button, all the values in the form display correctly again.

Things I already tried:
- set the filter again in the OnValidate trigger of the form in the case Rec is empty
- CurrForm.UPDATE in OnValidate.

I know is not much, I must admit I'm totally lost on this one.
Now, if Mulder and Scully are among the audience, could they please come solve this X-File? Preferably before I completely lose it, thank you! Hurry please, I've already started to address fictional characters in my posts, I don't want to think what comes next.

Also, sorry for my poor English, it's not my first language and this #@!$ problem has killed several of my braincells. ](*,)
Thanks a million in advance!

Leeluh

Comments

  • matttraxmatttrax Member Posts: 2,309
    You could try a currform.update in the OnActivateForm trigger. It's supposed to do so automatically when the form regains focus, but Navision often doesn't behave quite correctly.

    Can't remember which one, but I had a property where the default <No> property made the form behave differently than manually setting it to no. Can never assume Navision will act like it is supposed to.
  • leeluhleeluh Member Posts: 3
    ooops, sorry, I meant I had tried CurrForm.UPDATE in OnActivateForm trigger, and still no joy. I really should reread before posting 8-[
    Anyway, thanks for your reply matttrax.
Sign In or Register to comment.