Hi @v-xida-msft,
Thank you for your help in trying to sort this out> It is greatly appreciated.
A bit more info as requested:
My app uses the standard layout of Browse screen, Detail Screen and Edit Screen and allows the user to fill in Feedback forms/ attribute assessments.
The code used is as follows:
Browse Screen:
Next arrow in the Gallery:
Navigate(AttributeAssDetailScreen, None, {displayItem:ThisItem, DisplayItemID:ThisItem.ID})
Detail screen:
FromViewer item property is set to displayItem
Delete code:
Remove(Feedback, displayItem); If (IsEmpty(Errors(Feedback)), Back())
Edit Code:
EditForm(EditForm2);Navigate(AttributeAssEditScreen, ScreenTransition.None, {editItem:displayItem})
Edit Screen:
Editform2 Item property set to editItem
OnSuccess property code:
Navigate(AttributeAssEditScreen, ScreenTransition.None, {editItem: EditForm2.LastSubmit, editItemID: EditForm2.LastSubmit.ID}); Refresh(Feedback)
X-Icon:
If (EditForm2.Mode = New, ResetForm(EditForm2) & Navigate(AttributeAssBrowseScreen, None), Navigate(AttributeAssDetailScreen, ScreenTransition.None, {DisplayItem:EditForm2.LastSubmit}) & ResetForm(EditForm2))
The code works fine as such, but I find the LastSubmit function is too slow resulting in a multitude of issues:
- The user can navigate away from the edit screen after a new form has been created while the OnSuccess Property hasn't fired yet - results in navigation to the wrong record or a record error for editItem
-The user can navigate away from the edit screen when the OnSuccess property hasn't fired yet for an updated form - the record data held in editItem and displayItem is out of date and will display data from an older submission not the most recent one
Could you please provide any suggestions on how to deal with this situation? Is it better to work with the ID value only and then update the record from the data source on a different trigger? Can this issue be controlled via introduction of a loading screen or conditioning the visibility of the x-icon to the OnSuccess property of the form?
I have the same problem on a few similar apps so getting this fixed would really help me out massively.
Thank you