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

Using Back() To A Screen With An EditForm On It

Hi all,

 

I have an app with a Gallery (Gallery2) on the home screen. When a user clicks the edit icon it takes them to a screen with an edit form on it.

freddiejoseph1_0-1630922022947.png

 

freddiejoseph1_1-1630922136611.png

The Edit icon has an OnSelect:

ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Set(varFormData, ThisItem); Navigate(Phase1); Select(Parent); UpdateContext({varEdit: false})

 

The save form button has an OnSelect of:

SubmitForm(frmPhase1); If(IsEmpty(Errors(OverpaymentDatabase)), Notify("Successfully Saved", NotificationType.Success) && Navigate(Success); Notify(First(Errors(OverpaymentDatabase)).Message, NotificationType.Error))

 

I then have a simple success screen. I want the user to go to this screen, then navigate back to the screen they were just on. However when they click the ok button (with onselect: ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Back(); UpdateContext({varEdit: false}) ) it takes the user back to the previous screen, but the changes the user just made don't appear in the form.

freddiejoseph1_2-1630923095813.png

Why does the newly submitted information now appear in the form? It must be something to do with the data source not refreshing, or the OK button somehow not refreshing the selected item from Gallery2.

 

Thanks,

 

Freddie

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Shivam,

 

I have actually solved the issue myself. It was to do with the reset form, which I must have left by accident in some of my OnVisibles on the different screens. I removed them and now it seems to work fine.

 

Rather than navigating away from the screen, I also not just use a variable which blocks the screen rather than navigating away from it. This seems to work well!

 

Thanks for replying to me 🙂

 

Freddie

View solution in original post

2 REPLIES 2
shivam38
Advocate I
Advocate I

hey @freddiejoseph1 I just want an information from you that what you want to do like :-

    - You want the users to be sent on the main page from where they have just clicked on the pencil icon instead of going back on OK button pressed then you need to change your code as follows :- 

ResetForm(frmPhase1); ResetForm(frmPhase2); ResetForm(frmPhase2_1); ResetForm(frmPhase3); ResetForm(frmEmergencyServices); ResetForm('frmHCC/OCC_2'); ResetForm(frmLondonBoroughs_1); Navigate(Screen Name).

Note - Screen Name is same as on which you have gallery2.

And your answer about last thing why data is not displayed which is changed by the user on going back just because you have use ResetForm() which results in resetting the data after clicking on ok button so you will find nothing there.

Hi Shivam,

 

I have actually solved the issue myself. It was to do with the reset form, which I must have left by accident in some of my OnVisibles on the different screens. I removed them and now it seems to work fine.

 

Rather than navigating away from the screen, I also not just use a variable which blocks the screen rather than navigating away from it. This seems to work well!

 

Thanks for replying to me 🙂

 

Freddie

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,951)