I have developed a custom form for a SharePoint list. I want to execute some code that essentially rebuilds a collection whenever the form opens.
The code itself is correct because it works perfectly when triggered by a button. However, I would like it to run automatically when the form opens, without needing to use a button.
This would allow the data in the custom form to be displayed correctly every time a user opens it from the SharePoint list.
I have tried the OnStart
event, as well as the OnVisible
event of the form's screen, but it seems that the code is being ignored.
Any suggestions?
Thank you.