Editable := True/False, Runtime 'bug' ?

XypherXypher Member Posts: 297
So my company uses NAV 4.0 (SP1 & SP3), I have not tried this in SP3 yet but here goes my problem...

At runtime I have a form that acts as both a List & Card for a table. I want the card only modifiable when the user clicks a button. So therefore I have several fields set to Editable := TRUE or FALSE frequently. My dilemma is after a control has been set to Editable := FALSE and back to TRUE the background color still shows grayed out, and so far the only way to remedy this is to hide the form and show it again (visible := false -> true) which looks rather glitchy and unpleasant.

Anyone have any ideas? or a better suggestion to complete the task at hand?

Answers

  • David_SingletonDavid_Singleton Member Posts: 5,479
    Just set the whole form to editable / non editable. Thats how I normally do it.
    David Singleton
  • XypherXypher Member Posts: 297
    So they will still be able to scroll through the list and click the 'Modify' button if the form is set to Editable := FALSE ?
  • kinekine Member Posts: 12,562
    You can try to call CurrForm.Update and UpdateControls. To which value is the Editable set on the form? If it is false by default, the control will have wrong backgroun. If you set it (or leave it true by default) to true in design time and disable it in OnOpen, it will look correctly...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • XypherXypher Member Posts: 297
    The pre-runtime Editable condition of the fields is what overall determines what the background color is going to be.

    Try it... Set a field to Editable := FALSE, with it initially being set to TRUE, and you'll notice the background is still white.

    This does appear to be a Redraw bug in NAV.

    I have tried various different other methods to alleviate this problem, such as Update & UpdateControls, with no results.

    As far as 'OnOpen' setting the fields' Editable condition it may adjust the background effectively but only during that procedure. How about the many other times I set the fields to FALSE/TRUE Editable during the course of the form's "life"?
  • XypherXypher Member Posts: 297
    Thank you so much Kamil!

    This issue has been bugging me for so long.

    It works properly if you initially set the Form/Control to Editable := FALSE in the OnOpen procedure.
  • kinekine Member Posts: 12,562
    You are welcome! 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • CaponeCapone Member Posts: 125
    :thumbsup:
    Hello IT, have you tried to turn it off and on?
    Have you checked the cables?
    Have you released the filters?

    http://www.navfreak.com
Sign In or Register to comment.