cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
Microsoft
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
Highlighted
Microsoft
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.

Highlighted
Helper II
Helper II

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

Highlighted
Microsoft
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.

Highlighted
Helper II
Helper II

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. 

Highlighted
Microsoft
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)

Highlighted
Helper II
Helper II

Re: Customise EditForm - all locked except one part

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

 

edit mode.JPG

Highlighted
Microsoft
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

Highlighted
Helper II
Helper II

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,321)