When a user clicks on an item in the gallery, the initial form screen gets stuck on, "Getting your data ...". Oddly this goes away if you click back to the gallery and then click on any item in the gallery again. It only happens on the first try.
Based on other posters I've tried:
1) Reduced the number of lookups back to sql server in order to reduce the amount of data its pulling
2) Switched all of the collections to load concurrently() initially in the app
Concurrent(
Collect(EmployeeData, '[dbo].[App_PAFNewProj_Emp_vps]'),
Collect(Loc, '[dbo].[App_PAFNewProj_Loc_vps]'),
Collect(Cust, '[dbo].[App_PAFNewProj_Cust_vps]')
)
3) Added, ResetForm(Form1) into the OnSelect in the Gallery
None of the above has worked.
Any other thoughts? Is there anything I could provide that would be helpful?
Solved! Go to Solution.
Hi @TesDA
I'm not certain as to why that is except that it is not typical to put a Patch() in the OnSelect property of a gallery that uses an edit form. I think we are making progress. As a test, let's simplify! Remove the Patch() and add the fields that you intended to patch to your edit form and make the default properties of the controls in those cards to be what you intended with your patch. Then, make the following changes. In the OnSelect of the arrow in the gallery just have
EditForm(Form1);Navigate(scrForm1,ScreenTransition.None)
On the Item property of Form1
Lookup('[dbo].[App_PAFNewProj_Main]',ID=Gallery1.Selected.ID)
See if that helps.
Hi @TesDA
Please show the Items and OnSelect properties of the gallery and the Datasource and Item property of the target form.
@Drrickryp Sure!
Gallery_Main
Items: Filter('[dbo].[App_PAFNewProj_Main]', (TextInput1.Text in Agency || TextInput1.Text in ProjName || TextInput1.Text in EntryUserName) And (Dropdown1.SelectedText.Value in PAFProjEntryStatus))
OnSelect: ResetForm(Form1)
NextArrow OnSelect: Patch('[dbo].[App_PAFNewProj_Main]', ThisItem, {EditedBy: User().FullName, EditedWhen: Now()}); Set(varFormMode,"edit"); Set(varRecord,ThisItem); Navigate(scrForm1,ScreenTransition.None);
Screen: scrForm1
Form: Form1
DataSource: '[dbo].[App_PAFNewProj_Main]'
Item: If(varFormMode = "edit", Gallery_Main.Selected, varRecord)
Hi @TesDA
I had a few ideas about your formulae.
OnSelect:
Patch('[dbo].[App_PAFNewProj_Main]', ThisItem, {EditedBy: User().FullName, EditedWhen: Now()});
/*Why Patch at this point when you can have these fields set by defaults in the Edit form?*/
EditForm(Form1); // This is the preferrred way to set the form mode
Set(varRecord,ThisItem);
Navigate(scrForm1,ScreenTransition.None)
Screen: scrForm1
Form: Form1
DataSource: '[dbo].[App_PAFNewProj_Main]'
Item: Lookup('[dbo].[App_PAFNewProj_Main]',ID=varRecord.ID)
@Drrickryp I made the edits you suggested and Getting your data no longer appears, however the first screen/ form isn't defaulting back to the values based on the item clicked in the gallery. If I go back to the gallery and click on the same item or even something different - all of the default values populate correctly. It only happens on the initial click in the gallery after loading the app.
Hi @TesDA
I'm not certain as to why that is except that it is not typical to put a Patch() in the OnSelect property of a gallery that uses an edit form. I think we are making progress. As a test, let's simplify! Remove the Patch() and add the fields that you intended to patch to your edit form and make the default properties of the controls in those cards to be what you intended with your patch. Then, make the following changes. In the OnSelect of the arrow in the gallery just have
EditForm(Form1);Navigate(scrForm1,ScreenTransition.None)
On the Item property of Form1
Lookup('[dbo].[App_PAFNewProj_Main]',ID=Gallery1.Selected.ID)
See if that helps.
User | Count |
---|---|
251 | |
250 | |
82 | |
45 | |
27 |
User | Count |
---|---|
350 | |
265 | |
127 | |
60 | |
58 |