How to change the control properties ?

philippegirodphilippegirod Member Posts: 191
edited 2004-02-16 in Navision Financials
Is there a way to change the properties of a control once opened ?

I have a form (tab) and a MenuButton, I want to disable one of the MenuItems if the the record has some values.

For instance, if my record (Job Journal Line) has a type <> type::resource, my menu item should disapear when I click on the MenuButton. Is it possible ? How ?

Thanks a lot for your help, and thanks for all the help I've already received in this phorum.
My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light

Comments

  • DenSterDenSter Member Posts: 8,307
    No you can't disable individual selections on the menu. What you could do is create another menu button that looks the same, but doesn't have the one selection, and then according to the record value, you set the visible property of either control.

    So if the value is 'resource', you set ResourceButton.VISIBLE to TRUE and OtherButton.VISIBLE to FALSE, and vice versa.

    It's not a solution, but a workaround.
  • eromeineromein Member Posts: 589
    But it's not really a standard Navision way to do that kind of things.........
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • DenSterDenSter Member Posts: 8,307
    No that's true, but standard Navision has so many limitations, you have to think outside the box :).

    If you'd want to do something that resembles standard Navision, you'd add a testfield on the field that you want to test to the menu selection, so that the user gets an error message like 'type must not be Resource in Job Journal Line 10000'.
  • eromeineromein Member Posts: 589
    I disagree...

    I had a very nice peace of text that explained why, but I lost it when I pressed the post button ;)

    But I'm sure... somewhere deep in your hard and mind... You agree with me. I'm sure!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • FabriceGFabriceG Member Posts: 12
    Standard or not. That's the question.
    Answer: follow the request from the customer. If he don't want a error message use an other way.
  • DenSterDenSter Member Posts: 8,307
    Ultimately yes, what the customer wants goes, BUT... It is our responsibility to point out to the customer when they are asking for non-standard things and provide them with alternatives, so that users will have a consistent interface with an application that is hard enough to learn in the first place.

    I personally don't really like the Navision interface, but I usually go along with it just so they don't get confused. I've seen many forms that are spiced up and look great if that were the only form. Then, other forms in the same database have a completely different look/feel to them. In that case you will have to train a user for each individual form, and if you use 'a standard' (doesn't have to be Navision standard, but be consistent) you can teach them a concept and they will pick up on other forms intuitively.
Sign In or Register to comment.