Community
Showing results for 
Search instead for 
Do you mean 
Reply

Set Company Link

New Member
Posts: 19
Country: USA

Set Company Link

Hi Everyone,

I am curious about a behavior displayed during the process of linking a contact to a company. When you are in ACT, you can associate a contact to a company from the contact layout by selecting a pop-up company dialog. When the company is selected, it shows in the company field as a "clickable" hyper link. In the contact list view, the company will also show as a hyper link.

I attempted to set some contact / company associations programmatically using the SetCompanyLink() method, but unfortunately, the companies that were linked did not display as links. Is this not the correct approach to linking companies? Is there an additional step needed in order to display the company as a hyper link?

Thank you for your time,
Everett
Copper Contributor
Posts: 98
Country: United States

Re: Set Company Link

Everett,
 
Make sure that you call _yourContact.Update() after the SetCompanyLink()
 
This step is missing in the example code, but once added works fine.
 
HTH,
 
Carlton Jones
Sage Software
Copper Contributor
Posts: 98
Country: United States

Re: Set Company Link

//Example 2

//This example create a contact and company record then links the two of them together.

Contact newContact;

Company newCompany;

//Create a new Contact.

newContact = ActFwk.Contacts.CreateContact();

newContact.FullName = "New Contact";

newContact.Company = "New Company";

newContact.Update();

//Create a new Company.

newCompany = ActFwk.Companies.CreateCompany();

newCompany.Name = "New Company";

newCompany.Update();

//Link them. This will create the link to the Company name in the Contact record.

newContact.SetCompanyLink(newCompany);

newContact.Update(); //Not in original example

MessageBox.Show("Done");

Carlton Jones
Sage Software
New Member
Posts: 19
Country: USA

Re: Set Company Link

Hi Carlton,

Thanks for your quick reply. Your suggestion worked flawlessly.

Everett
New Member
Posts: 2
Country: USA

Re: Set Company Link

Along the same lines, I would like to be able to link between contacts.  For instance, I may have an attorney and a paralegal that works for the attorney in my database.  For the attorney record, I would like to create a "lookup or link" field and place the paralegal's 'full contact name' or 'conact ID' in that field.  When I click on the field, I would be taken directly to the paralegal's record.  Drop down enabling would also be useful. Any ideas?
Copper Contributor
Posts: 70
Country: USA

Re: Set Company Link

[ Edited ]

Good day Aubol,

 

I would suggest that you ensure that ALL of the paralegals etc all have their own company records.

 

Then I would use STATIC Contact Links on Company Records to provide that Click-to-go-to link functionality you need.

 

As you probably know, those Static links work rather like the COMPANYID on a Contact record except that from the Contact's perspective, you get a One-To-Many relationship (as opposed to the One-To-One relationship with the Contact's CompanyID at contact level).

 

Perhaps they really should be compared to Group Links - but much COOLER.

 

.

        compList(0).SetStaticContacts(cList2) ' The Company (just looked up by GUID) gets the Contact(s) in the Contact lookup.
        compList(0).Update()

.

 

Cheers,
Kevin
================
Kevin Ritch
V8Software.com
Support@V8Software.com

 

 

 

 

 

Message Edited by kritguy on 09-20-2008 07:20 PM