0

I have an issue with Screen On visible parameter condition if user unauthorized else navigate, in case user is not authorized to view a specific in screen, then the user will be redirect to another screen. if there is any another option please provide me with a solution.

If(
    IsBlank(
            Param("ID")
   ),
   0,
   If (
        LookUp(
                <<Table_Name>>, 
                <<Field_name>> = Param("ID"),
                <<Field_name>>
              ) = Office365Users.MyProfile().Mail,
        Param("ID"),
        Navigate(Auth_404)
      )
)

Thanks in advance

2 Answers2

1

Rather than executing the code OnVisible of your first screen, have you considered moving the code to OnStart of the application?

SeaDude
  • 3,725
  • 6
  • 31
  • 68
0

You can attain this by a workaround,

Have a button 'button_A' with On select = Navigate(Auth_404) and then change the screen onvisible to

If(
IsBlank(
        Param("ID")),0,If (
    LookUp(
            <<Table_Name>>, 
            <<Field_name>> = Param("ID"),
            <<Field_name>>
          ) = Office365Users.MyProfile().Mail,
    Param("ID"),
    Select(button_A)
  ))

for more info on Trigger OnSelect on a Button

Ansar
  • 386
  • 1
  • 14