formLayout

Hi

i need to show set of buttons to a particular users and need to show other sets of buttons for some users how can i achieve this

am using formLayout

i have written like this but this is giving error, let me know the correct way to write

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Hi,

    You can use show when condition available in button widget. Add your conditions for each button.

    a!formLayout(
      contents: {
        
      },
      buttons: {
        a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              showWhen: a!isUserMemberOfGroup(
                loggedInUser(), cons!CR_GRP_BOARD_OF_DIRECTORS_GROUP
              ),
              label: "Button 1"
            ),
            a!buttonWidget(
              showWhen: a!isUserMemberOfGroup(
                loggedInUser(), cons!CR_GRP_BOARD_OF_DIRECTORS_GROUP2
              ),
              label: "Button 2"
            )
          }
        )
      }
    )

Reply
  • +1
    Certified Lead Developer

    Hi,

    You can use show when condition available in button widget. Add your conditions for each button.

    a!formLayout(
      contents: {
        
      },
      buttons: {
        a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              showWhen: a!isUserMemberOfGroup(
                loggedInUser(), cons!CR_GRP_BOARD_OF_DIRECTORS_GROUP
              ),
              label: "Button 1"
            ),
            a!buttonWidget(
              showWhen: a!isUserMemberOfGroup(
                loggedInUser(), cons!CR_GRP_BOARD_OF_DIRECTORS_GROUP2
              ),
              label: "Button 2"
            )
          }
        )
      }
    )

Children
No Data