Disable Button in Navision

david.weeksdavid.weeks Member Posts: 96
edited 2004-02-18 in Navision Attain
Hello All,

Another task I have been given is to disable a certain command button in a form if the status of a field in the Sales Header is of a certain value.

What procedure should I take to do this?

Thanks

Comments

  • eromeineromein Member Posts: 589
    first of all.... I think you post this one in the wrong forum...

    but to get back to your thingy!


    Give the controle (button) a name. this should make it possible to do something like:

    currform.contolename.enable := true or false;

    if you would like to disable the button when a order is released you could do something like this :

    currform.contolename.enable := status = status::released;

    or maybe the oppicide? Disable when not released :

    currform.contolename.enable := status <> status::released;

    you will have to program this like in a function and call this funtion from 3 triggers on your form.

    1.) The OnOpenForm trigger.
    2.) The OnAfterGetRecord (or OnAfterGetCurrentRecord)
    3.) The OnValidate trigger of the Status field.

    1, so the form will enable or disable the button when openening the form
    2, so the button will have the correct status when you scroll though the records
    3, so the button wil have the right status when you will change the status field in the header...


    you dig?
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • david.weeksdavid.weeks Member Posts: 96
    Hi eromein

    Thanks for the help, the button enabling and disabling is now working.

    I will try to ensure that I post in the relevant forum next time......

    Best Regards

    David
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    Topic moved from "Navision Tips & Tricks".
Sign In or Register to comment.