I have a custom controller, and I want to disable certain buttons. If I use the following global method during onShow of the form to make the buttons visible/invisible it works fine:
var currentState = "true"
if ( globals.UserGroupName == "Administrators" )
{
forms.Navigation.elements.BranchListingButton.visible = currentState
forms.Navigation.elements.ClassificationListingButton.visible = currentState
forms.Navigation.elements.ProjectActivityListingButton.visible = currentState
forms.Navigation.elements.ResponsibilityListingButton.visible = currentState
}
else
{
forms.Navigation.elements.BranchListingButton.visible = !currentState
forms.Navigation.elements.ClassificationListingButton.visible = !currentState
forms.Navigation.elements.ProjectActivityListingButton.visible = !currentState
forms.Navigation.elements.ResponsibilityListingButton.visible = !currentState
}
However, If I try instead to disable the buttons, it doesn’t work.
var currentState = "true"
if ( globals.UserGroupName == "Administrators" )
{
forms.Navigation.elements.BranchListingButton.enabled = currentState
forms.Navigation.elements.ClassificationListingButton.enabled = currentState
forms.Navigation.elements.ProjectActivityListingButton.enabled = currentState
forms.Navigation.elements.ResponsibilityListingButton.enabled = currentState
}
else
{
forms.Navigation.elements.BranchListingButton.enabled = !currentState
forms.Navigation.elements.ClassificationListingButton.enabled = !currentState
forms.Navigation.elements.ProjectActivityListingButton.enabled = !currentState
forms.Navigation.elements.ResponsibilityListingButton.enabled = !currentState
}
Is disabling of buttons on a custom controller not allowed, or am I doing something wrong?