We are trying to add API code to determine if an incoming phone or email should be marked Primary or not depending on the status of the constituents current phones or emails.
We have upgraded to RE 7.95 and this upgrade changed how phones are stored so we are having some confusion. In order to familiarize ourselves with the new phone fields we have written some code to view the Phone Type in a MsgBox. This way we can be sure that we are accessing the correct fields. However, we are still having some problems as there as still fields marked PreferredAddress.Phones (which isn't where phones are stored anymore so it's confusing).
Here is the code we've started with which is returning a "blank" even though our constituent has a Preferred Email and a Home phone.
Dim oPhones as CConstitPhones
Dim oPhone as IBBPhone
For each oPhone in oRec.PreferredAddress.Phones
MsgBox ("Here is the current phone code: " & oRec.Fields(Blackbaud.PIA.RE7.BBREAPI.EPhonesFields.Phone_fld_PhoneType))
Any help would be greatly appreciated!
We have a different but related issue. If we would like to mark all phones and emails being imported from the source data as primary when there is data in that field (not the blanks). How can this be accomplished via IOM? Regular expression?
This could be accomplished through a virtual field and a dictionary. Map the virtual field to "Is primary", set the function to copy field, and the seed to whichever field contains the phone number or email. Then apply a dictionary to that virtual field that has a value to match on of ^.+$ and a replacement value of Yes and turn on regular expressions. This dictionary only populates "Yes" if there is a value in the cell that contains the email address or phone number.
Dim method As System.Reflection.MethodInfo = oRec.GetType().GetMethod ("get_Phones")
Dim phones = method.Invoke(oRec, Nothing)