Community
Showing results for 
Search instead for 
Do you mean 
Reply

New babe to SDK - 3 : C# to create a new contact

Tuned Listener
Posts: 14
Country: Australia

New babe to SDK - 3 : C# to create a new contact

        static void Main(string[] args)
        {
            ActFramework actApp = new ActFramework();
            actApp.LogOn("C:/xxxx/act.pad", "name", "password");

 

            Contact newContact = actApp.Contacts.CreateContact(); //to create an entity            

           newContact.FullName = "ZZZZ_NewContact_SDK";       

     

//solution 1 to set property value            

           newContact.Fields["CUST_ContactTable2_122431.CUST_Age_122551875", true] = "190";    

        

//solution 2 to set property value            

            newContact.Fields["Age",FieldNameType.Alias] ="130";                        

 

            newContact.Update();

            Console.WriteLine(newContact.ID.ToString()); 

            Console.ReadLine();

}

Copper Contributor
Posts: 14
Country: Germany

Re: New babe to SDK - 3 : C# to create a new contact

there's a solution 3, if you have a FieldDecriptor object for a contact field:

 

fieldDescriptor.SetValue(newContacts, "130");

 

Cheers.