Method Community

 

Hiding a grid row based on user role

Last post 04-01-2014 8:05 AM by Method_Adam. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-30-2014 8:12 PM

    Hiding a grid row based on user role

    Hello all.

    I am making a modification to the OpportunitiesList screen. I need to make sure that the Description field in the grid is hidden for roles that do not have the priviledge to see this information. My approach is to ad a Show/Hide Field/Object action on the OnScreenLoad event that will look at the role of the current user and hide the field if the user does not have a certain role.

    My problem is that I don't know which event to use in order to ensure that the action sequence I need to create will be run anytime the grid refreshes.

    Here is the sequence I want to apply.

    Assign Value to Action Result -- Get the user Record ID

    Retreive Value From Table -- Look up the roles of the user

    Start Conditional Statement -- If the user does not have the ... role

        Show/Hide Field/Object -- Hide the Description field

        Stop Processing More Actions -- Return

    End Conditional Statement -- End If

    Show/Hide Field/Object -- Else show the description field

    Please help if you can...


  • 03-31-2014 3:32 PM In reply to

    Re: Hiding a grid row based on user role

    Hi rezibtutsanai,

    You'll run into an issue with the way you have this setup. That being that you will not be able to find the role of the user. Unfortunately, Method does not actually store the user's role in a table. If you were to export the Users table, you will see that the Roles field actually contains tabgroups. Previously, Roles were determined by tabgroups, which is why the Roles field show tabgroups.

    Depending on how many users need or don't need this field, there are a few ways to approach this. My best suggestion would be to create two sections with the grid in both sections. One with the field and one without. Then you can put condiitional statements in to the OnScreenLoad to show/hide the appropriate section based on the user.

    Hope this helps,

    - Adam


    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
  • 03-31-2014 8:12 PM In reply to

    Re: Hiding a grid row based on user role

    OK.

    I gave up on the idea of using roles and decided to use the groupings of the user. In this way I can check to see if a user is in a certain group and use that to exclude an object.

    Where is the Object ID for the grid! I see many selections in the Field/Object drop down, but nothing that explicitly identifies the grid I want to hide. I tested this with another object and was able to get it to disappear, so I figure if I can hide the grid, I can create a copy without the description field and I'll be all set if I can access the grid that I have created.

  • 04-01-2014 8:05 AM In reply to

    Re: Hiding a grid row based on user role

    Hi,

    Unfortunately, you can't hide grid objects with the Show/Hide Field/Object. The best way to do this would be to create two sections, each with a grid. Obviously, one would have the grid with the description field and the other without. Then you can use the Show/hide section action to hide the section and grid.

    - Adam

    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
Page 1 of 1 (4 items)