Skip to main content
kavyam0002
May 10, 2022
Solved

validation

  • May 10, 2022
  • 14 replies
  • 0 views

Hi,

i have a picker field when i select some particular users names it has to show validation message else no 

i have written like this but it is showing for all users whoever i select in picker field 

    Best answer by kavyam0002

     if(
            isusermemberofgroup(
              ri!approver_txt,
              {
                cons!CR_GRP_BOARD_OF_DIRECTORS_GROUP
              }
            ),
            cons!CR_NEXT_AUTHORITY_VALIDATION_MESSAGE[3],
            if(
              isusermemberofgroup(
                ri!approver_txt,
                {
                  cons!CR_APP_GRP_HOC_GROUP,
                  
                }
              ),
              cons!CR_NEXT_AUTHORITY_VALIDATION_MESSAGE[3],
              if(
                isusermemberofgroup(
                  ri!approver_txt,
                  {
                    cons!CR_APP_GRP_DCEO_GROUP
                  }
                ),
                cons!CR_NEXT_AUTHORITY_VALIDATION_MESSAGE[3],
                if(
                  isusermemberofgroup(
                    ri!approver_txt,
                    {
                      cons!CR_APP_GRP_CEO_GROUP
                    }
                  ),
                  cons!CR_NEXT_AUTHORITY_VALIDATION_MESSAGE[3],
                  null
                )
              )
            )
          )

    this worked

    14 replies

    stefanhelzle0001
    Brainy
    May 10, 2022

    Your logic shows the message in case the user is a member of that group. Is that what you want?

    kavyam0002
    May 10, 2022

    yes, if the selected user is belongs to that user then show error/warning message 

    stefanhelzle0001
    Brainy
    May 10, 2022

    OK, but what is wrong with it? What did you do to test your logic?

    May 10, 2022

    Please note that function loggedInUser() does not have parameters. You can remove it and pass the username as first parameter of the a!isUserMemberOfGroup() function.

    If this does not resolve your issue you may not have enough rights to view the users or group contents you are requesting. Check group visibility policies for this.

    stefanhelzle0001
    Brainy
    May 10, 2022

    Thanks Laurens, I did not spot that.

    You are not checking for the selected user, but always for the logged in user, which is you.