Demo 8 - Command button
Objective: In this demo, you will show how to add a command button to a model-driven app that will reject and cancel a pet trick when in evaluation status.
Task 8.1 - Add command button
- Edit the model-driven app.
- Edit the command bar for the Pet Tricks view.
- Select Main form.
- Add a new command.
- Select Power Fx.
- Enter
Reject Trick
for Label. - Select Reply for Icon.
- Set Action to Run formula.
- Open formula bar and enter
Patch('Pet Tricks', Self.Selected.Item, {'Status Reason': 'Status Reason (Pet Tricks)'.Rejected})
. - Set Visibility to Show on condition from formula.
- Open formula bar and enter
If(Self.Selected.Item.'Status Reason' = 'Status Reason (Pet Tricks)'.Evaluation, true, false)
.