Community
Showing results for 
Search instead for 
Do you mean 
Reply

Modify the First Name and Last Name fields from Contact

Yan
New Member
Posts: 8
Country: Ireland

Modify the First Name and Last Name fields from Contact

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!!

Nickel Super Contributor
Posts: 441
Country: UK

Re: Modify the First Name and Last Name fields from Contact

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

Yan
New Member
Posts: 8
Country: Ireland

Re: Modify the First Name and Last Name fields from Contact

[ Edited ]

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!!

Message Edited by Yan on 08-28-2008 07:51 AM
Employee
Posts: 236
Country: USA

Re: Modify the First Name and Last Name fields from Contact

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");

 

New Member
Posts: 31
Country: USA

Re: Modify the First Name and Last Name fields from Contact

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

Ric
Tuned Listener
Posts: 3
Country: Netherlands

Re: Modify the First Name and Last Name fields from Contact

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