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

2 REPLIES 2
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.
Riyaas
New Member

 Hi all,

        When i click edit button, the edit screen appear after loading previous new screen for 2 seconds.

I'm suing this formula in onedit sarepoint integration

Set(SharePointFormMode,"Edit Form");EditForm(EditForm);Navigate(EditScreen);

Can anyone please suggest solution?

Thanks in advance

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,235)