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

Customise EditForm - all locked except one part

Hi Guys,

 

I have a simple form which i want users to only be able to edit one section of this.  So when they click the edit button, they can only select the last option 'Cancel this request'.  All other parts should not be edited.   Is this possible?

 

I touight using something like this in the diaply mode on 'Days datacard' for example would do the trick but no joy

 

If(EditForm1.Mode.Edit, DisplayMode.View, DisplayMode.Edit)

 

Many thanks

 

EDIT FORM.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft dinusc
Microsoft

Re: Customise EditForm - all locked except one part

Are you sure you're setting the formula on the card who's derect parent is the Edit form? Try to replace the "Parent.Mode" with "EditForm1.Mode" (use the form name instead).

View solution in original post

8 REPLIES 8
Microsoft dinusc
Microsoft

Re: Customise EditForm - all locked except one part

Hello Craig,

Is you intent to permanentely avoid editing any fields, besides the last one? If so then an easier solution should be to replace the Parent.DisplayMode with DisplayMode.View on all the cards that should not be edited. You will have to unlock them before updating.

Craig77
Level: Powered On

Re: Customise EditForm - all locked except one part

Thanks for coming back to me, yes i do want to lock all other ecept the last one but only when its in edit form, not when a new form is created.  Hope this makes sense

Microsoft dinusc
Microsoft

Re: Customise EditForm - all locked except one part

I would just set all other cards "DisplayMode" properties to DisplayMode.View. The only possible issues with this could be the case when some fields are required to have values. Iin this case you would either have to configure default values on those fields or asisgn some default values via formulas in PowerApps.

Craig77
Level: Powered On

Re: Customise EditForm - all locked except one part

But when i set all displaymodes to view you can't then edit these when its in NewForm(Editform1) mode. 

Microsoft dinusc
Microsoft

Re: Customise EditForm - all locked except one part

Ah, I see the issue now. Your initial formula was very close then! Please try:

YourCard.DisplayMode = If(Parent.Mode = FormMode.Edit, DisplayMode.View, Parent.DisplayMode)

Craig77
Level: Powered On

Re: Customise EditForm - all locked except one part

thanks for that, i'm getting the below error message at the moment

 

edit mode.JPG

Microsoft dinusc
Microsoft

Re: Customise EditForm - all locked except one part

Are you sure you're setting the formula on the card who's derect parent is the Edit form? Try to replace the "Parent.Mode" with "EditForm1.Mode" (use the form name instead).

View solution in original post

Craig77
Level: Powered On

Re: Customise EditForm - all locked except one part

Amazing the below worked, thank you very much

 

If(EditForm1.Mode = FormMode.Edit, DisplayMode.View, Parent.DisplayMode)

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,579)