cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rgriffiths
Level: Powered On

IF - Mulitple actions

I am trying to make two actions happen on IF:

 

    If(
        CrdStaffMemberData.Text = User().FullName,
            Set(RecordChanged,"1");
            DisplayMode.Edit,
            DisplayMode.View
    )

 

I understood that ; chained actions together but it is saying I have an invalid IF statement. Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: IF - Mulitple actions

Hi @rgriffiths

 

It looks like you're trying to set a card to 'read-only' if the 'Staff Member' of the record doesn't match the currently logged on user.

If you're setting the value of a property (eg DisplayMode) with an If statement, the If statement should only return your desired value and nothing more.

The Set function is a 'Behavior method' - this is a function that changes the state of an app. You can only use 'Behavior methods' in 'Behavior Properties', such as the 'OnSelect' or 'OnVisible' properties of a control. It's not possible to call Set in a non-behavior property such as DisplayMode and I think this is the cause of your problem.

1 REPLY 1
Super User
Super User

Re: IF - Mulitple actions

Hi @rgriffiths

 

It looks like you're trying to set a card to 'read-only' if the 'Staff Member' of the record doesn't match the currently logged on user.

If you're setting the value of a property (eg DisplayMode) with an If statement, the If statement should only return your desired value and nothing more.

The Set function is a 'Behavior method' - this is a function that changes the state of an app. You can only use 'Behavior methods' in 'Behavior Properties', such as the 'OnSelect' or 'OnVisible' properties of a control. It's not possible to call Set in a non-behavior property such as DisplayMode and I think this is the cause of your problem.