Community
Showing results for 
Search instead for 
Do you mean 
Reply

2011 SDK Examples

New Member
Posts: 10
Country: USA

2011 SDK Examples

I'm just starting out with the 2011 ACT SDK and struggling to find any COMPLETE C# source code examples. Getting headaches in trying to find out which assemplies to include that will allow me to simple create a new contact. I have the Act. Framework.Interop loaded and can open a Act database usnig the LogOn() method but I can't find the assemply to include that will resolve the Contract Class.

 

Thanks

Platinum Elite Contributor
Posts: 14,384
Country: Australia
Employee
Posts: 1,163
Country: USA

Re: 2011 SDK Examples

If you've already added a reference to Act.Framework.dll, then in your project you'll need to add a using statement for Act.Framework.Contacts. 

 

The full examples can be found in within the download the path should be something like: \\Sage ACT! 2012 SDK\Content\Code Samples

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 10
Country: USA

Re: 2011 SDK Examples

Does that Act.Framework.Dll ship with Act 2011? I can not find it in the application program directory on the install.

New Member
Posts: 10
Country: USA

Re: 2011 SDK Examples

OK, I found the Act.Framework.Dll in the ActSync directory on my server. My next question is what class do I use to populate the address field for the Contact?

Employee
Posts: 1,163
Country: USA

Re: 2011 SDK Examples

First, in regards to assemblies for the current version, I usually just make a copy of \\ACTWG\GlobalAssemblyCache and paste the entire folder somewhere near my projects folder so the assemblies are easier to find.

 

I posted some sample code in this thread that shows how to get the field descriptors for various contact fields. Once you have the DBFieldDescriptor it has a SetValue method you can use.

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 10
Country: USA

Re: 2011 SDK Examples

Sorry, but I have no idea where the \\ACTWG\GlobalAssemblyCache is located?

Could you pls advise?

New Member
Posts: 10
Country: USA

Re: 2011 SDK Examples

I have found the assemblies needed on the media disk and now can compile without issue.

 

Didn't see any code examples on this thread and still looking for help in saving an address somewhere for my new contact I just saved.

Employee
Posts: 1,163
Country: USA

Re: 2011 SDK Examples

Apologies for not mentioning they would be on the install media previously. I included a link to another thread in my previous post that shows, as I mentioned, how to get a DBFieldDescriptor, once you have this object you can call it's SetValue method to save the data.

 

Below I show both of the methods for setting the value of a field, to do this for the address field simply swap out the field names I have for TBL_Contact.Business_Line1 

 

Contact c = _ActApp.ApplicationState.CurrentContact;
ContactFieldDescriptor customField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("TBL_CONTACT.CUST_SDKTEST_104653792");
ContactFieldDescriptor userField3 = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("TBL_CONTACT.USER3");
int i = 32;
 
customField.SetValue(c, i); 
c.Fields["TBL_CONTACT.USER3", Act.Framework.MutableEntities.FieldNameType.Real] = "TEST";
c.Update();
Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 14
Country: Australia

Re: 2011 SDK Examples

Hi,

 

I am having issues adding the assembly reference. I have added a reference to Act.FrameWork.dll and included "using Act.Framework". The reference seems to add fine, I can view all the framework types and Visual Studio promts when typing.

 

However when I build the solution I get the error "The type of namesapce act could not be found, are you missing an assembly reference...". Also, if I then try to view the Act.Framework reference in the object view it is not there.

 

Any help?

 

Cheers

Sam