Error: Run-time error '-21472198666 (80040666): A duplicate phone number and phone type exists. Remove the duplicate to save the record

This issue has been reported when updating a Raiser's Edge record directly, through Raiser's Edge integrations that include contact information updates (ex. RELO) and when using the API in RE 7.95 patch #1 thru patch #3 to add a phone number to a constituent record variations of the following error message are displayed:

Run-time error '-21472198666 (80040666):
A duplicate phone number and phone type exists. Remove the duplicate to save the record.

This issue only occurs after applying RE patch #1 for 7.95 with a duplicate phone number. It should be noted that new RE Business Rules for "Phone/Email options" are ignored and there is no way to control or bypass this issue in the API. This is an issue affecting all Custom Import solutions and any client using the API to add phone numbers (please see internal notes).
We have evaluated this issue and determined it’s likely a bug.  We have prioritized this issue and are researching and developing the necessary code changes. We will update this article when we have more information.  If you are experiencing this issue and are unable to continue working in the database because of this error, click Chat with Support, reference this article.

Steps to Duplicate

  1. Use the new CConstitPhone and CConstitPhones object to create an API application to add a phone number.
  2. Execute the application and note that the first run is successful but the second execution will fail with the error message.
The following sample code is used in the AddPhoneTest2.exe application to add a number to the Robert Hernandez record in RE sample data.

Public Sub TestSavingDuplicatePhones()
   
        Dim constit As New CRecord
        constit.Init SessionContext
         
        constit.LoadByField uf_Record_CONSTITUENT_ID, "96"
        
        Dim parent As IBBPhonesParent
        Set parent = constit
        
        Dim phone As CConstitPhone
        Dim phones As CConstitPhones
        Dim dataObj As IBBDataObject
        Dim phone2 As CConstitPhone
        Dim dataObj2 As IBBDataObject
        
        For Each phone In parent.phones
            Set dataObj = phone
            If dataObj.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_PHONETYPE) = "Home" Then
                Set phones = parent.phones
                Set phone = phones.Add
                Set dataObj2 = phone
                dataObj2.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_NUM) = "7185551234"
                dataObj2.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_PHONETYPE) = "Home"
                              
                Exit For
            End If
        Next
        
        constit.Save
        constit.Closedown
        Set constit = Nothing
   
   End Sub

Environment

 Raiser's Edge
 7.95
 7.95.6283.1

Was this article helpful?