Need help troubleshooting a record's related action visibility

I'm trying to allow a certain subset of a user group to see a related action in a record. If the user belongs to GRP_7 AND has authorization for that organization, then the user should be able to see the related action. This code is from the visibility section of the record I'm interested in. I added everything between the comments, everything else is the original code. The part that I added worked on a different record in achieving the same thing, but doesn't seem to work in this case. The user can see related action 'A' and not 'B' but should see both 'A' & 'B'. The following is the SAIL code for the visibility of related action 'B'.

= and(
  or(
    rf!isActive,
    and(
      rf!isActive,
      rf!deactivationDate > now()
    )
  ),
  or(
    rf!Status = cons!PENDING_STATUS,
    rf!Status = cons!NEW_STATUS
  ),
  or(
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_1,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_2,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_3,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_4,
        "id"
      )
    ),
    and(
      or(
        isusermemberofgroup(
          loggedInUser(),
          cons!GRP_6
        ),
        isusermemberofgroup(
          loggedInUser(),
          cons!GRP_7
        )
      ),
      rule!IsUserContact(
        userName_txt: loggedInUser(),
        organizationId_int: rf!organizationId
      )
    ),
    /* Is Corporate? AND Authorized? */
    and(
      
      isusermemberofgroup(
        loggedInUser(),
        cons!GRP_7
      ),
      
      contains(
        rule!GetAuthorizedOrgsNumberByUserName(
          loggedInUser()
        ),
        rf!organizationIdentifier
      )
      
    )
    /* END Is Corporate? AND Authorized? */
  )
)

  Discussion posts and replies are publicly visible

Parents
  • You can use this code if this variable is integer type

    and(

         isusermemberofgroup(

           loggedInUser(),

           cons!GRP_7

         ),

         contains(

           tointeger(rule!GetAuthorizedOrgsNumberByUserName(

             loggedInUser()

           )),

           rf!organizationIdentifier

         )

    But I thinks visibility rule is correct and there is some problem in process model that you are using as related action as you are saying this code is is working for another related action

    Problems in process may be like:

    1. You are passing the value in process model variable from record which is not a parameter type variable or it have different datatype

    here TriggerSource and productId should be parameter type variable in process model update product and there should be no any start form in process model. You can check it from properties dialog box of process model if there is any start form than please delete it and check the parameter data types.

    2. If this is showing under related actions tab of record but not showing on summary dashboard than click on checkbox under summary view from record.

     

    Thanks

Reply
  • You can use this code if this variable is integer type

    and(

         isusermemberofgroup(

           loggedInUser(),

           cons!GRP_7

         ),

         contains(

           tointeger(rule!GetAuthorizedOrgsNumberByUserName(

             loggedInUser()

           )),

           rf!organizationIdentifier

         )

    But I thinks visibility rule is correct and there is some problem in process model that you are using as related action as you are saying this code is is working for another related action

    Problems in process may be like:

    1. You are passing the value in process model variable from record which is not a parameter type variable or it have different datatype

    here TriggerSource and productId should be parameter type variable in process model update product and there should be no any start form in process model. You can check it from properties dialog box of process model if there is any start form than please delete it and check the parameter data types.

    2. If this is showing under related actions tab of record but not showing on summary dashboard than click on checkbox under summary view from record.

     

    Thanks

Children
  • Thank you for your response. The rule I'm using to fetch the user's authorized divisions returns a list of text, I had not thought of converting to integer. I will give it a try. I also believe the visibility rule to be correct as I unit tested it extensively at this point.
    The process would actually begin from the record's related action so all the initial data must be pulled from the record. The issue I'm facing is merely the desired user not being able to see the button for the action.