On Aug 29, 2011, at 11:43 PM, Markus Ruggiero wrote:
Thanks Ramsey,
This is a completely standalone table with no relationships that contains one record with a couple attributes that define the configuration of the app. I was so deep into doing everything without programming that I missed the obvious. Your answer triggered the following solution: Having a simple page with a message and only a CANCEL button for the Create* pageConfiguration should solve my problem.
Beware. That solution only prevents creating new instances of your class when the creation is called using D2W, and then only for ways of creating it that match your rule. Any other code can still very simply call:
EOUtillities. createAndInsertInstance(editingContext, "MySingleton")
and get a new instance.
At a minimum, you should override all the easy ways to create a new instance in the class to simply return the Singleton instead of actually creating a new one.
I think a better solution (off the top of my head, not tested, Chuck will probably say it's all wrong, yadda, yadda) would be: