cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skong
Resolver I
Resolver I

display form change to edit form or new form based on button click.

Request_Add_New_Edit.JPGI have a screen with two gallery and a form and two buttons. One button when click it create an add new form and other button change display to edit mode.

 

I was able to make the cascade galley works and the form can display a record selected by second galley. I would like to implement the onSelect edit button to change the display form to edit form. And when I click add new it change to edit new form.  Is that possible I would like to stay in the same screen ?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@skong , 

Change the Item to 

LookUp(
   YourListName,
   ID=Gallery2.Selected.ID
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

11 REPLIES 11
WarrenBelz
Super User
Super User

@skong ,

You simply need to choose between

EditForm(YourFormName)

for Edit Mode and 

NewForm(YourFormName)

for New Mode and 

ViewForm(YourFormName)

to go back to read-only.

Is this what you are meaning?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

The FormViewer1 is a display form. When I changed the onSelect to the add button to NewForm(FormViewer1) it complains I have an invalid arguments and on the edit button to EditForm(FormViewer1) I got the same error message. 

 

@skong 

If you have added a new Display Form, this will not work (you cannot "convert" it) - you will need to replace it with a new form (Edit)

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If I replace the form to new form(edit) how can I change to display mode with a click button ?

@skong ,

As per my previous post

EditForm(YourFormName)

for Edit Mode and 

NewForm(YourFormName)

for New Mode and 

ViewForm(YourFormName)

to go back to read-only.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.



I change the form to edit form. When I select an item to gallery2 it opened in edit mode with selected item filled in the form. When I click the add button it change the form to new form by resetting the form which is good. But when I go back to gallery2 select another item the form no longer filled with selected item.  Do you know why ? The item property of the form is set as gallery2.selected. 

@skong , 

Change the Item to 

LookUp(
   YourListName,
   ID=Gallery2.Selected.ID
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

I change item to your code doesn't work. I end up on the select button on gallery2 add this                                      Select(Parent); EditForm(Form3);  I will accept your suggestion as solution. Thank you very much for your help.

@skong ,

Select(Parent) is inferred when you select an item in a gallery (it becomes the GalleryName.Selected), so you should not need to do it once you select an item (I do not have it on probably over 100 galleries). You do however need to put the EditForm(Form3) to instigate the edit.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,398)