I got this error from time to time (not all the time). The plugin pass one PrefName but when it runs in OpenDentBusiness.PrefC code, it changes to different PrefName. It's very unpredictable the behavior of this function. Please see example below:
I call PrefC.GetString(PrefName.BirthdayPostcardMsg) and when it runs the function code, it turns PrefName.BirthdayPostcardMsg into PrefName.BillingUseBillingCycleDay.
I got this error with my other plugin when try to get the ConfirmTextMessage but it is changed into ConfirmStatusTextMessaged
Because PrefName is an enum (really just passed as an int position in the enumeration) it almost seems like the call is using a different version of the enum then the GetString() function. Might check to see that your OpenDentBuisness reference isn't pointing to an older version? Or try cleaning the solution and recompiling (sometimes Visual Studios does some weird stuff and a clean usually fixes most "this is weird" errors)
GetString refers to the latest version of OpenDentBusiness, how can it call a different version of enum? integer value of BirthdayPostcardMsg is 91 but when pass to GetString, it become 88 which is BillingUseBillingCycleDay.
UPDATE:
- After multiple update and clean up, it finally works as expected. I would go with GetRaw(string prefName) for the time being. Hope the name of the Pref will not change.
Thanks for your advice
M
Last edited by mopensoft on Wed Jul 06, 2016 6:15 pm, edited 1 time in total.
Are you giving your Enum a default value? I have seen it mess up like this if you did something to this when making your Enum:
public enum PrefNames {
....
BirthdayPostcardMsg=88,
....
}
Other than that, I can't think of any other reason why the OpenDentBusiness that you compiled with your enum in it wouldn't know about the Enum you made.
In order to understand recursion you must first understand recursion.
No, I would not touch OD code except adding hooks. I get the value by converting PrefName enum to INT.
I think the reason could be like tgriswold mentioned. I have to open OD 16.2.26 solution file, clean up and recompile. At first the problem still but after I upgrade to 16.2.28, clean up and recompile, OD solution. After than, go to my plugin project, remove and add reference to OD and ODBusiness again. It all works now. I guess that the referencing issue.