Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to add contact programmatically?

New Member
Posts: 8
Country: USA

How to add contact programmatically?

I writing my application on C#, and one of the functionalites of it - add Contacts and Companies without runing ACT! (I using 9.0). To do this I using "CreateContact" function, but it creates empty contact and I find out how to set Last, First and Full Names of Contact. But how I can set fields like phone, mobile phone, email, country and others? It will be good if write some code for demonstration.
Copper Contributor
Posts: 98
Country: United States

Re: How to add contact programmatically?

[C#]

public Contact CreateContact()

//Example 1
Contact NewContact = ActFwk.Contacts.CreateContact();

//Example 2
//This example creates a new Contact record, populates some field, and saves the record.

Contact NewContact;
NewContact = ActFwk.Contacts.CreateContact();
NewContact.Company = "Company Name";
NewContact.FullName = "Contact Name";
NewContact.Fields["TBL_CONTACT.USER1",true] = "Some Data";
NewContact.Update();
Carlton Jones
Sage Software
Copper Contributor
Posts: 98
Country: United States

Re: How to add contact programmatically?

For additional information on Group and Contact Fields...
 

      private void button1_Click(object sender, System.EventArgs e)

      {

            ////----Framework Login----////

            ActFramework actFm = new ActFramework();

            actFm.LogOn(@"C:\Documents and Settings\All Users\Documents\ACT\ACT for Windows 10\Databases\act10demo.pad",

                "Chris Huffman", "");

            ////----Framework Login----////

 

                  ContactFieldDescriptor[] fList;

            //GroupFieldDescriptor[] gList;

 

                  fList = actFm.Contacts.GetClipboardContactFieldDescriptors();

            //gList = (GroupFieldDescriptor[]) actFm.Groups.GetFieldDescriptors();

           

                  dataGrid1.DataSource = fList;

            //dataGrid1.DataSource = gList;

 

                  actFm.LogOff();

      }

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

Re: How to add contact programmatically?

Thanks a lot!
New Member
Posts: 8
Country: USA

Re: How to add contact programmatically?

Ok. Now I have another problem how create new user in ACT! programmaticaly. I can't find any exaples for using Role type. Maybee some one have any clues?