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

Condition to stop someone from editing a record based on a value in another field

I want to be able to stop people from editing a record via my app, if its 'Status' is Active or Completed.

For my Status column (plain text), I have four types; Pending, Available, Active and Completed.

I then have an 'Edit' button in my gallery that opens the selected record in the Form so that the user can modify existing details . But I want to limit this button to only open a record for modifying provided it's current status in Pending or Available.

 

Any help on the right way to structure the formula would be much appreciated. I am thinking at this stage that I should be able to do this with an If statement? So if the status equals x&y, open form in edit mode, otherwise...........

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Condition to stop someone from editing a record based on a value in another field

@LabDude 

You could enable/disable the button using this code in its DisplayMode property.

 

If(Label_Status.Text in ["Pending","Available"] ,DisplayMode.Edit, DisplayMode.Disabled)

 

Note: I am assuming the status is shown in a Label but you could reference it some other way if needed.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Condition to stop someone from editing a record based on a value in another field

@LabDude 

You could enable/disable the button using this code in its DisplayMode property.

 

If(Label_Status.Text in ["Pending","Available"] ,DisplayMode.Edit, DisplayMode.Disabled)

 

Note: I am assuming the status is shown in a Label but you could reference it some other way if needed.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

LabDude
Level: Powered On

Re: Condition to stop someone from editing a record based on a value in another field

Thank  heaps - learning new things all the time. Didn't think to use the condition on a different property.

Works perfectly.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,922)