Preferences in Open Dental Business. (feature request?)

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Preferences in Open Dental Business. (feature request?)

Post by Justin Shafer » Fri Nov 01, 2019 12:10 am

https://stackoverflow.com/questions/342 ... ing-change

I am doing something like this:

toothChart.SetToothNumberingNomenclature((ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers));

which works.. until I go to a higher version of OD... (it returns 0 from another preference) the UseInternationalToothNumbers which is say preference number 650 in the database, changes later to another number, and in the source code since the enum list is being added, but alphabetized in the source code, causing the numbers to change.. and not link correctly if that sounds right. But.. alphabetized code looks better... :D

Anyways... not sure if I should just ignore the preference number and just hard code it based off of the OD version number.. or... query the database.. which is probably like.. a worse idea. :D

Just thought I would throw this out there.

:idea: (Feature Request?)
Maybe in prefs.cs in OD business...
instead of:
UseInternationalToothNumbers,

adding integers to the strings so you can alphabetize the list AND not change the integers the enum is assigned to?
UseInternationalToothNumbers = 823,

This was going forward.. as you guys add more preferences.. the integers won't change... as UseInterNationalToothNumbers.. used to be some other number?

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: Preferences in Open Dental Business. (feature request?)

Post by Justin Shafer » Fri Nov 01, 2019 12:28 am

I think I should just set my own preference in my form. :D

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Preferences in Open Dental Business. (feature request?)

Post by allends » Fri Nov 01, 2019 1:12 pm

Justin,

OpenDental does not use enum values to reference the preference enum, we use the enum names.
https://www.opendental.com/OpenDentalDo ... preference
The PrefName column in that table is what the program uses as its "Primary" key.

The code that you posted
toothChart.SetToothNumberingNomenclature((ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers));
will not get a value from a preference that is not UseInternationalToothNumbers.

Without your code in front of me I can't say exactly what the problem is, but I can tell that you are not using PrefC.Get... methods.

Long story short, if you are using our PrefC.Get... methods then you won't have any issues with getting data that is from a different pref.
Allen
Open Dental Software
http://www.opendental.com

Post Reply