I have about 95 warnings on unused variables. From the Variables pane, I see they are all context variables.
The thing is I did not explicitly define any context variables (e.g. UpdateContext(...)). All the definitions of the 95 variables point to the OnSelect code of an icon in the gallery. The code simply does a navigate, set a global variable and does an EditForm:
Navigate(
CIProjectCharterMain,
ScreenTransition.Fade,
OLGallery.Selected);
Set(varSource,"Proposal");
EditForm(ProjectCharterForm)
What can I do to fix this?
Hi all I logged an incident with Microsoft Support and they gave me the solution. I was passing Gallery.Selected in my Navigation function. That should never be done, it will create context variables for all my form fields. Instead for the form I should have items as Gallery.Selected (which it already was anyway). After removing the passing of Gallery.Selected, all the performance issues are gone.
Hi @WarrenBelz
Yes it is being used in many places. The warning is not on this global variable, but on all the fields in my edit form.
But I did not declare those as variables, for example Actual Spend, that is just a field in my edit form. You can see it says the definition is the OnSelect property of the edit icon in the gallery and I have posted the code of the edit icon, there is no context variable defined there.
Hi @zhona9 ,
Have you checked you are using varSource anywhere else (put it in the Search icon at the bottom of your left menu)