08-28-2008 05:10 AM
Hi, is there anybody who knows how to modify the First Name and Last Name fields from an existing Contact? Since my application allows the user to modify the Full Name from an existing Contact, it would be nice that our user can modify the First Name and Last Name fields as well.
For example, if the user changes the Full Name to Anne Marie Smith, it will automatically use Anne as First Name and Smith as Last Name. But I would like to allow the user to modify the First Name as "Anne Marie".
Thanks in advance!!
08-28-2008 07:26 AM
As far as I am aware the first and last name fields are read-only, you have to modify the contact field and let act parse the rest.
Tom
08-28-2008 07:48 AM - edited 08-28-2008 07:51 AM
Oh no... So will there any ACT! developers pass by here and add this as a new feature?
To be able to modify the First and Last Name fields from an existing Contact is very useful since most of the Chinese names DO NOT have MIDDLE NAME!! They tend to have more than one words for their FIRST NAME!! In some cases, they can have two words as LAST NAME as well!!
And I am sure not only Chinese names will have that kinds of format...
P.S. Thanks Tom!!
08-28-2008 09:05 AM
You can set the first, middle, and last name parts of a full name by calling SetNameParts(...) on the ContactFieldCollection, so as long as the parts do exist in the full name:
Contact.ContactFieldCollection fields = someContact.Fields; fields.SetNameParts("John Bob Doe", "John", "Bob", "Doe");
09-23-2008 08:26 PM
Ok. So that allows you to modify the First, Middle and Last. However, what about the name Prefix (or Title) i.e. Dr., Prof., etc., and the name Suffix i.e. Jr., I, II.
T
04-10-2009 09:35 AM
I have done some trial and error on this and came to this solution.
First I set Fullname with the variable cName which contains also prefix and suffix. After that I use Setnameparts
cContact.FullName = cName
cfc = cContact.ContactFields
cfc.SetNameParts(cname, cFirstname, cMiddlename, cLastname)
This works for me. Take in mind that your prefixes and suffixes must be defined in Act>Tools>preferences, otherwise they won't be recognized.
Good luck