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

Detail-screen shows wrong item after submitting a new item.It shows second existing record

I have two browse screen as I connected multiple data source in my app.

I have duplicated the first browse screen & Detail Screen and renamed appropriately and modified OnSelect Property for all the icons.

 

Now the problem is when i create a new Item (Connected to a SharePoint list), the form does not closes as expected, instead its displaying the existing record not the newly added items in editmode.

 

Problem is that the detail screen is not displaying the newly created item, but  displaying the item that added earlier.

 

EditForm2 , Item = TimeReg_BrowseGallery.Selected

Submit icon , OnSelect = SubmitForm(EditForm2)

---------------------------------

DetailForm2, Item = TimeReg_BrowseGallery.Selected

Edit Icon ,OnSelect = EditForm(EditForm1);Navigate(TidReg_EditScreen, ScreenTransition.None)

 

How to solve this issue.

 

 

5 REPLIES 5
Drrickryp
Super User
Super User

Hi @PapithaSekar 

In the OnSuccess property of the edit form, create a global variable from the immediately submitted form's ID.

 

Set(varID, Form1.LastSubmit.ID)

 

Use this in the Item property in the display form

 

Lookup(dataset,ID=varID)

 

mdevaney
Super User
Super User

@PapithaSekar 

The typical pattern to do this is:

 

Put this code in the OnSelect property of the submit button

SubmitForm(Form1);

 

Place this code in the OnSuccess property of the form

Set(varLastRecord, Form1.LastSubmit);
ViewMode(Form1);
Navigate(next_screen, None);

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

we are all chasing Warrenwe are all chasing Warren

 

Have a doubt, in Navigate function should i give detail screen?

 

 

Set(varLastRecord, EditForm1.LastSubmit);
ViewMode(EditForm1);
Navigate(Canvas1, None);

 

Its giving error "Invocation of Unknown or unsupported function"

 

@PapithaSekar ,

Your screen name should be in the Navigate and you need to refer to the field as suggested.

Set(varLastRecord,EditForm1.LastSubmit.ID)

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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