Page 1 of 1

Guidance for Plugin Settings (.config, Prefs, etc...)

Posted: Wed Mar 14, 2018 8:56 pm
by tholmes
What's the guidance for persisting plugin specific settings (e.g. connection strings to remote resources)? And how would one keep these updated?

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Posted: Thu Mar 15, 2018 8:14 am
by cmcgehee
The recommended way is to create your own database table(s) within the Open Dental database. You can then use the class OpenDentBusiness.DataCore to read and write to these tables. Be sure to name your table something highly unique such as tholmes_connectionsettings.

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Posted: Fri Mar 23, 2018 4:38 pm
by tholmes
Thanks Chris, we're using a PluginAssemblyName.dll.config file right now housed in the OpenDental bin folder.

We'll look into migrating this into the OD database.

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Posted: Fri Mar 23, 2018 4:52 pm
by jsalmon
If those settings are computer specific then that might suffice. However, if those settings are supposed to affect the whole office I'm not sure that will work. Putting the settings in the database (via your own table or a custom preference entry in our preference table) is the way you can guarantee that every workstation connected to that database can get access to your plug-in settings. We have examples of how to do such things in our PluginExample project:
See the "Example - Complex Installation" section for more details:
http://www.opendental.com/manual/plugins.html