Community
Showing results for 
Search instead for 
Do you mean 
Reply

Problem with linking a contact to a group

Copper Contributor
Posts: 14
Country: Germany

Problem with linking a contact to a group

There is one DB where I cannot link a contact to a group. If I delete the group and create it new, I can link the contact, but if I unlink the contact and try adding the same contact to the same group later, the contact is not added.

Here's how I tried adding a contact:

Version1:

var cList = act.Contacts.GetContactAsContactList(contact);

group.AppendStaticContacts(cList);
group.Update();

 

Version2:

var gcontacts = group.GetStaticContacts(new SortCriteria[] { });

var ids = gcontacts.Cast<Contact>().Select(c => c.ID).ToList();
ids.Add(contact.ID);
var contactsToAdd = act.Contacts.GetContactsByID(new SortCriteria[] { }, ids.ToArray());
group.SetStaticContacts(contactsToAdd);
group.Update();

 

Both don't throw any exceptions and don't add the contact to the group.

 

Here's the code when I create a group and add the contact and it works:

var group = act.Groups.CreateGroup();
group.Name = groupFromSource;
group.AppendStaticContacts(cList);
group.Update();

 

ACT version is 2013 and this problem can be reproduced on 1 DB only. No group or contact-related errors in the LogViewer.exe. I made a copy of the DB via Save Copy As... and it has exactly the same problem.

 

What can I do to get more information about why this is happening? Are there any other methods that add a contact to a group?

Any help is appreciated.

Silver Super Contributor
Posts: 2,328
Country: USA

Re: Problem with linking a contact to a group

Have you tried running the maintenance routines inside ACT! and in actdiag on the database?  Sounds like a database issue to me.  Your code looks fine.


Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
Copper Contributor
Posts: 14
Country: Germany

Re: Problem with linking a contact to a group

Yes, that was the first thing that I did.