cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
renewtx
Frequent Visitor

How to fix SharePoint List Custom Form with two screens opening wrong screen second time around

Hello,

I have a SharePoint list for which I created a custom form using PowerApps.  The form worked fine when I initially just had the default screen and I was able to View, Edit, and Create new items as expected.  However, I had a requirement to be able to Print my form, so I created a new (Print) Screen by inserting a Print Landscape layout screen and then added a button on my form to load the Print screen (I needed to do a separate screen/form as I needed to reformat some of the data specifically for printing).  Loading and printing appears to work fine in Preview mode.  And when I save and publish the form updates to SharePoint, when I first click on New or Edit for an item, I initially get the correct for as expected.  

 

However, if I click on New or Edit, for example, then click on my button to Print (which loads the Print Screen), that loads correctly as well.  But if I cancel the Print Screen, the next time I try to View, Edit, or Create New, the Print Screen is loaded instead of the standard New/Edit/View screen.  I have to refresh my browser in order to get back to the standard New/Edit/View screens after activating the Print screen.

 

Any idea how to fix this?  I have tried using the App OnStart() function to navigate to my standard screen, but that does not fix it (apparently OnStart(() is only loaded the first time you access the app).

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

@renewtx , the OnStart only fires once when you first open an item in SharePoint in that session. When you close the custom form it is just hiding it, so when you click on another item it just becomes visible again and loads the selected item.

 

Try this as a workaround. Go to the SharePointIntegration control in the app and in the Advanced property add Navigate(FormScreen1, ScreenTransition.None) to the OnNew, OnEdit and OnView properties.

 

Out of the box example for OnNew:  

NewForm(SharePointForm1); Navigate(FormScreen1, ScreenTransition.None)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Jeff_Thorpe
Super User
Super User

@renewtx , the OnStart only fires once when you first open an item in SharePoint in that session. When you close the custom form it is just hiding it, so when you click on another item it just becomes visible again and loads the selected item.

 

Try this as a workaround. Go to the SharePointIntegration control in the app and in the Advanced property add Navigate(FormScreen1, ScreenTransition.None) to the OnNew, OnEdit and OnView properties.

 

Out of the box example for OnNew:  

NewForm(SharePointForm1); Navigate(FormScreen1, ScreenTransition.None)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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