Dynamically Set permissions on a Form

IrishGiriIrishGiri Member Posts: 61
Hi,

I have a boolean field in a form that I want to allow a small number of super users to block access to all other users. I want that when a super user disables the form by ticking the boolean the form becomes totally uneditable for ALL users BUT only the boolean is editable for the super users (maybe they have to unblock again and can only do this if the boolean is editable obviously).

What code and in which trigger can achieve this dynamically??

Any help would be a help!
Cheers,
Paul.

Comments

  • idiotidiot Member Posts: 651
    We have done this before using button.
    We control the button visibility using permissions so not authorized persons are unable to view the button.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • diptish.naskardiptish.naskar Member Posts: 360
    You can write the code on the open form first and then copy the same in the OnAfterGetRecord, so even if the user uses the navigation in the database your code will work.

    You can use a 'if' statement to check whether the user is a super user to make the field editablke and non editable respectively.
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
  • David_SingletonDavid_Singleton Member Posts: 5,479
    IrishGiri wrote:
    Hi,

    I have a boolean field in a form that I want to allow a small number of super users to block access to all other users. I want that when a super user disables the form by ticking the boolean the form becomes totally uneditable for ALL users BUT only the boolean is editable for the super users (maybe they have to unblock again and can only do this if the boolean is editable obviously).

    What code and in which trigger can achieve this dynamically??

    Any help would be a help!
    Cheers,
    Paul.

    Paul, don't do it this way. You can spend hours on details that really are not important. In this case since its for super users, it would be silly to do this amount of work. What you are suggestion here. i.e. using code to individually set every field ont he form but one to editable non editable just so that the super user can tick a box is not the way to go.

    Instead, just make the whole form editable/non editable in code, and then use a button to change the state. Now if these super users are really obsessed with the tick box just make the button look like a tick box, it will still be less work that the way you are trying now.
    David Singleton
Sign In or Register to comment.