making the control property dynamic

aliennavaliennav Member Posts: 449
I am using a command button in sales order form.My requirement is that whenever the difference between order date and the work date is more than say 4 days then caption of that command button should be displayed otherwise not.

Tried several things but of no use faced some r the other problems.
How can I achieve this?

Comments

  • mama Member Posts: 23
    Since I don't know how to change caption of the button dynamically, you can try following:
    create 2 buttons: first with caption, second without, and put them together (one on another). Depending on date make proper button visible and another one invisible.
  • kinekine Member Posts: 12,562
    It is not possible to make the menu button dynamic. There is only one solution - the one Ma wrote about...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aliennavaliennav Member Posts: 449
    ma wrote:
    Since I don't know how to change caption of the button dynamically, you can try following:
    create 2 buttons: first with caption, second without, and put them together (one on another). Depending on date make proper button visible and another one invisible.
    Dear friend.I appriciate ur suggestion but want to tell you that one button can also solve my problem.In that case the 2 cases will be:
    1) show button if date difference is greater than 3 days.(In this case caption will be shown with the button).
    2) do not show the button if the difference is less than 3 days.(In this case button will not be shown).


    I want to know that after adding the button can i change the visibility of the button dynamically??
    that will solve my problem.
    NOTE:other than seeing the caption the button have not any other task(Push action or something like that).I just want to display the caption.

    Any doubts ,kindly ask and suggest a solution.
    thanx in advance
  • kinekine Member Posts: 12,562
    If you need just the caption, you can use Label or EditBox. But of course, button is a way too. You can set the VISIBLE property from code making the button/label/editbox visible or hidden. :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aliennavaliennav Member Posts: 449
    kine wrote:
    . You can set the VISIBLE property from code making the button/label/editbox visible or hidden. :wink:


    That's what I wanted to know
    HOW?
  • NaviDevNaviDev Member Posts: 365
    Just give a name to the control and you can access/set its properties. eg. visible, enable.
    Navision noob....
  • kinekine Member Posts: 12,562
    Look into the Symbol Menu to variable CurrForm - Controls - <ControlName>
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    aliennav wrote:
    I am using a command button in sales order form.My requirement is that whenever the difference between order date and the work date is more than say 4 days then caption of that command button should be displayed otherwise not.

    Tried several things but of no use faced some r the other problems.
    How can I achieve this?

    Keep it simple, just copy the way its done on the Notes or Comment button on the customer card.
    David Singleton
Sign In or Register to comment.