Community
Showing results for 
Search instead for 
Do you mean 
Reply

Associating a History and Contact record

Accepted Solution Solved
Copper Contributor
Posts: 21
Country: United Kingdom
Accepted Solution

Associating a History and Contact record

I have a requirement to link a pre-existing History record with a Contact (and also Company) records.

 

I can see that this can be done with Activities as here: -

 

ActivityList = ACTFramework.Activities.GetActivitiesForContact(Contact, FirstInstanceRestriction.None)
For Each Activity As Activity In ActivityList
    Activity.ActivityContacts.Add(Contact)
    Activity.Update()
Next

 

Is there an equivalent for History records?

Thanks.
Luke 


Accepted Solutions
Solution
Accepted by topic author lukedev
‎09-25-2015 03:20 AM
Silver Super Contributor
Posts: 2,328
Country: USA

Re: Associating a History and Contact record

Yes.  Just set the contact list property to a list of the contacts you want to associate.

 

I think it's:  thisHistory.ContactList = thisContactList

 

If that doesn't work and it isn't obvious to you how to do it post back and I'll post some real code.

 

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!

View solution in original post


All Replies
Solution
Accepted by topic author lukedev
‎09-25-2015 03:20 AM
Silver Super Contributor
Posts: 2,328
Country: USA

Re: Associating a History and Contact record

Yes.  Just set the contact list property to a list of the contacts you want to associate.

 

I think it's:  thisHistory.ContactList = thisContactList

 

If that doesn't work and it isn't obvious to you how to do it post back and I'll post some real code.

 

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: 21
Country: United Kingdom

Re: Associating a History and Contact record

Hi Stan,

 

Thanks for your reply - that works great.

 

If it helps anyone else, the code I used is below (given that ThisContact, ThisCompany and AnotherContact already exist).

 

Luke

 

 

Dim ThisContactList As ContactList
Dim ThisCompanyList As CompanyList

 

ThisContactList = ACTFramework.Contacts.GetContactAsContactList(ThisContact)
ThisCompanyList = ACTFramework.Companies.GetCompanyAsCompanyList(ThisCompany)

 

HistoryList = ACTFramework.Histories.GetHistories(Nothing, AnotherContact)
For Each History As History In HistoryList
      History.ContactList = ThisContactList
      History.CompanyList = ThisCompanyList
      History.Update()
Next