Related Action Visibility issue

We have an Attach Files related action on a record with the following visibility settings: 

isusermemberofgroup(user(loggedinuser(),"username"), cons!CTM_GROUP_ADMIN),
isusermemberofgroup(user(loggedinuser(),"username"), cons!CTM_GROUP_STUDY_MONITOR),
isusermemberofgroup(user(loggedinuser(),"username"), cons!CTM_GROUP_UPPER_MANAGER)

When logged in as myself, an Admin, I am able to see and use the Attach Files related action, but when logged in as a Study Monitor or Upper Manager, the Attach Files related action is not visible at all. 

The original Visibility was set to: 

and(
if(rule!CTM_isMonitoringEventClosed(rf!eventID), false, true),
or(
isusermemberofgroup(user(loggedinuser(),"username"), cons!CTM_GROUP_ADMIN),
isusermemberofgroup(user(loggedinuser(),"username"), cons!CTM_GROUP_STUDY_MONITOR)
)
)

I wanted to remove the validation to allow the related action to be executed at any time by users in the Admin, Study Monitor, or Upper Manager groups. Am I missing something else that needs to be changed in order to allow this? The Process Model has a start form, which I read in other discussions may cause issues, but that doesn't explain why I am able to execute the related action as an Admin and not the user types. Permissions on both the process model and the record type are open to each of these user groups. 

Thanks for suggestions.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Did you post the whole visibility rule expression? What you've posted isn't a valid expression as far as I can see, it would attempt to return 3 separate boolean values without a logical operator (and(), or(), etc) to join them. So at the very least you might get this working by wrapping the code snippet in a big or() statement.

    Also: I strongly suggest implementing visibility rules for related actions in an expression rule which takes the viewing username as a parameter. This makes testing (and refining) the visibility settings much easier.

    Also 2: there's no need to use the "user()" function here. I think loggedinuser() can be passed straight into isUserMemberOfGroup(), or if all else fails pass it through toString().

  • Hi Mike,

    Thank you! You were absolutely right, I wrapped the code with an or( ) statement and it worked perfectly. I didn't create the original code for the visibility, so I tried not to alter more than I needed to remove the validation, thus the user() function being there. Thanks for the additional suggestions, I will take note for future Visibility settings that I create.

    -Sarah

Reply Children
No Data