Community
Showing results for 
Search instead for 
Do you mean 
Reply

ACT! SDK fails to set the correct country code for a contact

Astute Commentator
Posts: 168
Country: United States

ACT! SDK fails to set the correct country code for a contact

I'm trying to update the phone number  for an ACT! contact and the Country code fails to update. When the contact is opened in ACT!, the default/old country code is showing. What am I missing?

 

Here's the code:

 

      FPhone = ACTFM.PhoneManager.GetPhoneNumberFieldDescriptor("TBL_CONTACT.BUSINESS_PHONE")
        ACTPhoneNumberStructure = New Act.Framework.Phones.PhoneNumber("(897)123-1234", "8971231234", Nothing, "44")
        Field_Phone_Object.SetValue(ACT_Contact,  ACTPhoneNumberStructure)

 

When ACT_Contact is viewed in ACT! through the ACT! interface, the country code is incorrect.

 

What am I missing here??? The ACT! SDK is able to set the correct country code for a contact, correct?

 

T

Employee
Posts: 1,163
Country: USA

Re: ACT! SDK fails to set the correct country code for a contact

I ran into a similar issue myself. I can with my code set the country code of the contat, however the view isn't updated with the correct information. I'm going to look into a bit more and if it is a defect I'll submit it. By the way here's my code if it's helpful in any way:

 

Contact c = _ActApp.ApplicationState.CurrentContact;
DBFieldDescriptor PhoneField = _ActApp.ActFramework.Contacts.GetFieldDescriptor("TBL_CONTACT .BUSINESS_PHONE");
PhoneNumber pNum = _ActApp.ActFramework.PhoneManager.GetPhoneNumberFromString(PhoneField.GetValue(c).ToString(), c);
pNum.CountryCode = _ActApp.ActFramework.PhoneManager.GetCountryCodeFromCountry("United Kingd om");
pNum.RawNumber = "6783460871";            
c.Update();  
Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: ACT! SDK fails to set the correct country code for a contact

Another strange thing is that if I update a contact's phone number, it will put 999 into the country code.

 

Keep me posted of what you find.

 

T

Astute Commentator
Posts: 168
Country: United States

Re: ACT! SDK fails to set the correct country code for a contact

I've been running a few experiments with the ACT! phone number in ACT! 2011. He're what I've found:

 

This country code issue is quite severe:

  - If you add a country code to a phone number, the country code does not get set.

  - Changes to a country code are not saved

  - Phone numbers created in ACT! change the country code to be 999 . Not sure how to replicate this but I get quite a few databases with phone numbers with 999 country code.

  - If you have a phone number (888)123-1234 and try to change the country code, the number is changed to (888)123 which basically erases the last 4 digits of the phone number

 

Did anyone test the country code mechanism object? It appears that it has never been used or tested in ACT!. This issue goes back all the way to ACT! 2007! ACT! customer must be really thrilled to find out that when they change a country code on the ACT! interface that the trailing part of the phone number is erased! AND to have 999 country codes! Wow! I'd consider this a VERY DAMAGING bug in ACT!.

 

Any news on a fix on this?

 

T

 

 

 

Employee
Posts: 1,163
Country: USA

Re: ACT! SDK fails to set the correct country code for a contact

The issue has been reported and is still under investigation.

 

However I did not have the same results changing the country code for contacts within the application, I was able to successfully open the dialog box and change the values for the country code and then display those values, I also double checked in sql and the values are updating correctly.

 

Via the SDK it is possible to change the country code for a contact, but there is definitely some unexpected behavior. It appears here that the country codes are being set:

 

Contact c = _ActApp.ApplicationState.CurrentContact;            
DBFieldDescriptor PhoneField = _ActApp.ActFramework.Contacts.GetFieldDescriptor("TBL_CONTACT.BUSINESS_PHONE");
PhoneNumber pNum = _ActApp.ActFramework.PhoneManager.GetPhoneNumberFromString(PhoneField.GetValue(c).ToString(), c);
            
pNum.CountryCode = _ActApp.ActFramework.PhoneManager.GetCountryCodeFromCountry("United Kingdom");
pNum.RawNumber = "6783460871";
pNum.FormattedNumber = "(678)346-0871";
PhoneField.SetValue(c, "(678)346-0871");
c.Update();
MessageBox.Show(c.Fields["TBL_CONTACT.BUSINESS_PHONE"true].ToString() + Environment.NewLine +
"Country Code: " + pNum.CountryCode.ToString());

 

The message box displays the correct country code and new phone number is displayed on the UI, even the dialog box displays the correct value. However the SQL values are not being set correctly, the display value is being changed but not the actual phone value.

 

As I mentioned, this issue has been submitted and is under investigation and as soon as a resolution or workaround is available I'll update this thread.

Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: ACT! SDK fails to set the correct country code for a contact

 

I am seeing quite some corruption with the country code issue in ACT! databases ranging from Germany, Switzerland, US, and Australia. The problem arises when you make the modification programmatically and then go in via the ACT! interface and make the modification manually. Depending on how you modify the country code, we've seen :

  • the phone number totally dissapear, or,
  • the country code not being saved, or,
  • the phone number being partially erased, or,
  • the country code is saved as 999, or,
  • the country code is saved as Nothing
  • any combination of the above

 

In countries like the islands in the Carribean, where the country code has to be present on every phone number in order for the Cell phones to work properly, we now advice users to eliminate ACT!' s phone number field and use a straight text field due to the corruption of the phone number (quite sad, but true). The user loses the phone field capabilities but at least his phone numbers are not corrupted. In some cases, the phone numbers of whole databases simply dissapear from the interface. Unfortunately, at the next update of the contact, the phone numbers also dissapear from the database resulting on a net loss of phone numbers. Not good for a CRM package to do this.

 

I see that this has been going on since ACT! 2005 and I've seen reports on this blog about this bug and it has not been fixed. WHY???

 

T